diff options
author | Evan Huus <eapache@gmail.com> | 2014-03-05 13:14:26 -0500 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2014-03-05 19:55:10 +0000 |
commit | be0b4b9dc8a63ef9b55cbaa7301800962d08a01e (patch) | |
tree | 8298179e8fd1f54259c057a2c11b2093ac6bd509 /test | |
parent | 970197c19f8e46c9c2d4c2897cc0bb52c1f27b3f (diff) |
Add test to dump glossaries.
All it checks is that they don't crash, but this is enough to catch malformed
extended value strings and other oddities.
Change-Id: If853e8e2b19517a784daa4bbb8e41eddc7c7ddd9
Reviewed-on: https://code.wireshark.org/review/520
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'test')
-rwxr-xr-x | test/suite-clopts.sh | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/test/suite-clopts.sh b/test/suite-clopts.sh index c474f5fd95..65b4e55dd5 100755 --- a/test/suite-clopts.sh +++ b/test/suite-clopts.sh @@ -279,6 +279,25 @@ clopts_step_valid_name_resolving() { fi } +test_dump_glossary() { + $TSHARK -G $1 > /dev/null + RETURNVALUE=$? + if [ ! $RETURNVALUE -eq $EXIT_OK ]; then + test_step_failed "exit status: $RETURNVALUE" + else + test_step_ok + fi +} + +# check that dumping the glossaries succeeds (at least doesn't crash) +# this catches extended value strings without the BASE_EXT_STRING flag +# among other problems +clopts_suite_dump_glossaries() { + for glossary in fields protocols values decodes defaultprefs currentprefs; do + test_step_add "Dumping $glossary glossary" "test_dump_glossary $glossary" + done +} + # check exit status of some basic functions clopts_suite_basic() { test_step_add "Exit status for existing file: \"""${CAPTURE_DIR}dhcp.pcap""\" must be 0" clopts_step_existing_file @@ -312,8 +331,8 @@ clopt_suite() { test_suite_add "Valid TShark single char options" clopts_suite_tshark_valid_chars test_suite_add "Interface-specific TShark single char options" clopts_suite_tshark_interface_chars test_suite_add "Capture filter/interface options tests" clopts_suite_tshark_capture_options + test_suite_add "Dump glossaries" clopts_suite_dump_glossaries test_step_add "Valid name resolution options -N (1s)" clopts_step_valid_name_resolving - #test_remark_add "Undocumented command line option: G" #test_remark_add "Options currently unchecked: S, V, l, n, p, q and x" } |