diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-04-16 09:43:16 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-04-16 09:43:16 -0400 |
commit | a48f7b85d096e68919b4eae8eba5607fe35e3c93 (patch) | |
tree | 95562c145e4fe3f29e314fc7e01dc2ca5342b875 /test_json.c | |
parent | 51c343c366942b073680b278091355369a126934 (diff) | |
download | gpsd-a48f7b85d096e68919b4eae8eba5607fe35e3c93.tar.gz |
Use t_time consistently for timestamps.
All regression tests pass. Livetesting with cgps looks good.
Diffstat (limited to 'test_json.c')
-rw-r--r-- | test_json.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test_json.c b/test_json.c index 38ad9d0c..2c365e6e 100644 --- a/test_json.c +++ b/test_json.c @@ -9,6 +9,7 @@ #include <stdlib.h> #include <string.h> #include <stddef.h> +#include <getopt.h> #include "gpsd.h" #include "gps_json.h" @@ -211,6 +212,20 @@ static const struct json_attr_t json_attrs_8[] = { int main(int argc UNUSED, char *argv[]UNUSED) { int status = 0; + int option; + + while ((option = getopt(argc, argv, "hD:?")) != -1) { + switch (option) { + case 'D': + gps_enable_debug(atoi(optarg), stdout); + break; + case '?': + case 'h': + default: + (void)fputs("usage: test_json [-D lvl]\n", stderr); + exit(1); + } + } (void)fprintf(stderr, "JSON unit test "); |