diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-03-02 04:27:02 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-03-02 04:27:02 -0500 |
commit | a46d1690a16ef5a4df38d10bb5bfa695fac13223 (patch) | |
tree | 79f17b89c97ebdaf670dbe57bdaed81e2e60f904 /test_packet.c | |
parent | 66292adf95903b63d9ed01056b3f2e9ba62c61ea (diff) | |
download | gpsd-a46d1690a16ef5a4df38d10bb5bfa695fac13223.tar.gz |
Add a feature and a minor fix to the packet-sniffer tester.
Diffstat (limited to 'test_packet.c')
-rw-r--r-- | test_packet.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test_packet.c b/test_packet.c index 77395c71..041b9120 100644 --- a/test_packet.c +++ b/test_packet.c @@ -322,8 +322,12 @@ int main(int argc, char *argv[]) int option, singletest = 0; verbose = 0; - while ((option = getopt(argc, argv, "t:v:")) != -1) { + while ((option = getopt(argc, argv, "e:t:v:")) != -1) { switch (option) { + case 'e': + mp = singletests + atoi(optarg) - 1; + (void)fwrite(mp->test, mp->testlen, sizeof(char), stdout); + exit(0); case 't': singletest = atoi(optarg); break; @@ -336,7 +340,7 @@ int main(int argc, char *argv[]) if (singletest) failcount += packet_test(singletests + singletest - 1); else { - (void)fputs("=== Packet identification tests\n ===", stdout); + (void)fputs("=== Packet identification tests ===\n", stdout); for (mp = singletests; mp < singletests + sizeof(singletests) / sizeof(singletests[0]); mp++) |