diff options
-rw-r--r-- | test/packet.test.chk | 4 | ||||
-rw-r--r-- | test_packet.c | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/test/packet.test.chk b/test/packet.test.chk index 2f3c8bb0..c487ce7c 100644 --- a/test/packet.test.chk +++ b/test/packet.test.chk @@ -1,5 +1,5 @@ -=== Packet identification tests - === 1: NMEA packet with checksum (1) test succeeded. +=== Packet identification tests === + 1: NMEA packet with checksum (1) test succeeded. 2: NMEA packet with checksum (2) test succeeded. 3: NMEA packet with checksum and 4 chars of leading garbage test succeeded. 4: NMEA packet without checksum test succeeded. 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++) |