aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite-clopts.sh
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2014-12-30 12:38:52 -0800
committerGerald Combs <gerald@wireshark.org>2014-12-30 21:20:28 +0000
commitdcbebe0eaccfba338eaa11df17197ab0f928766a (patch)
tree74c54e923e5371eb056a96da65aac3bd9d3ab3cd /test/suite-clopts.sh
parent3b578619098dc86e69a2ddbbc5b10d0fdb062537 (diff)
Test suite: Start testing our output for valid UTF-8.
Feed the output of `tshark -G <glossary>` to `iconv -f UTF-8`. Adjust a couple of the Bluetooth dissectors and X11 keysyms accordingly. Change-Id: I5b04dc3fa4734c8f0a795daf44bd398fe5ebc1bd Reviewed-on: https://code.wireshark.org/review/6146 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'test/suite-clopts.sh')
-rwxr-xr-xtest/suite-clopts.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/suite-clopts.sh b/test/suite-clopts.sh
index 4f9a7f9e7c..eedffa4f93 100755
--- a/test/suite-clopts.sh
+++ b/test/suite-clopts.sh
@@ -290,12 +290,31 @@ test_dump_glossary() {
fi
}
+test_dump_glossary_utf8() {
+ if [ "$HAVE_ICONV" != "True" ] ; then
+ test_step_skipped
+ return
+ fi
+
+ $TSHARK -G $1 | iconv -f UTF-8 > /dev/null 2> ./testout.txt
+ RETURNVALUE=$?
+ if [ ! $RETURNVALUE -eq $EXIT_OK ]; then
+ if [ -s ./testout.txt ]; then
+ test_step_output_print ./testout.txt
+ fi
+ 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"
+ test_step_add "Testing $glossary output encoding" "test_dump_glossary_utf8 $glossary"
done
}