diff options
author | Evan Huus <eapache@gmail.com> | 2014-06-26 23:43:51 -0400 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2014-06-27 03:47:32 +0000 |
commit | a87e292272e2275893695a3fc58ccb7f4625ecb6 (patch) | |
tree | 00009bde29fd2a5bd51e3ea7c62b82b878924684 | |
parent | 8d2eaaab51f0c64de0488b7b2b83cac7086628c1 (diff) |
Tighten the dump-glossary test.
1. The only indication we get of an out-of-order value string is a message on
STDERR, so check that and fail the test if STDERR wasn't empty.
2. This exposes an out-of-order value string in packet-stun.c; fix it.
3. This triggered the pre-commit hook on packet-stun.c, which noticed an API
error (ENC_ASCII -> ENC_ASCII|ENC_NA); fix that too.
Change-Id: I36f87a2a87b40537119562f22a7e3012716ff239
Lesson: automated testing/tooling is both wonderful and scary.
Reviewed-on: https://code.wireshark.org/review/2682
Reviewed-by: Evan Huus <eapache@gmail.com>
-rw-r--r-- | epan/dissectors/packet-stun.c | 4 | ||||
-rwxr-xr-x | test/suite-clopts.sh | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/epan/dissectors/packet-stun.c b/epan/dissectors/packet-stun.c index c90cfa825e..2f080b2900 100644 --- a/epan/dissectors/packet-stun.c +++ b/epan/dissectors/packet-stun.c @@ -325,8 +325,8 @@ static const value_string attributes[] = { {ICE_CONTROLLING , "ICE-CONTROLLING"}, {RESPONSE_ORIGIN , "RESPONSE-ORIGIN"}, {OTHER_ADDRESS , "OTHER-ADDRESS"}, - {MS_CANDIDATE_IDENTIFIER, "MS-CANDIDATE-IDENTIFIER"}, {MS_SEQUENCE_NUMBER , "MS-SEQUENCE-NUMBER"}, + {MS_CANDIDATE_IDENTIFIER, "MS-CANDIDATE-IDENTIFIER"}, {MS_SERVICE_QUALITY , "MS-SERVICE-QUALITY"}, {BANDWIDTH_ACM , "Bandwidth Admission Control Message"}, {BANDWIDTH_RSV_ID , "Bandwidth Reservation Identifier"}, @@ -1242,7 +1242,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole proto_tree_add_item(att_tree, hf_stun_att_reserved, tvb, offset+3, 1, ENC_NA); break; case MS_CANDIDATE_IDENTIFIER: - proto_tree_add_item(att_tree, hf_stun_att_ms_foundation, tvb, offset, 4, ENC_ASCII); + proto_tree_add_item(att_tree, hf_stun_att_ms_foundation, tvb, offset, 4, ENC_ASCII|ENC_NA); break; default: diff --git a/test/suite-clopts.sh b/test/suite-clopts.sh index f9932a70a5..ee1b9c4e9d 100755 --- a/test/suite-clopts.sh +++ b/test/suite-clopts.sh @@ -278,10 +278,13 @@ clopts_step_valid_name_resolving() { } test_dump_glossary() { - $TSHARK -G $1 > /dev/null + $TSHARK -G $1 > /dev/null 2> ./testout.txt RETURNVALUE=$? if [ ! $RETURNVALUE -eq $EXIT_OK ]; then test_step_failed "exit status: $RETURNVALUE" + elif [ -s ./testout.txt ]; then + test_step_output_print ./testout.txt + test_step_failed "Error messages on stderr" else test_step_ok fi |