diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/config.sh | 3 | ||||
-rwxr-xr-x | test/suite-clopts.sh | 19 |
2 files changed, 22 insertions, 0 deletions
diff --git a/test/config.sh b/test/config.sh index fc28e98874..5d2bae23c4 100755 --- a/test/config.sh +++ b/test/config.sh @@ -105,6 +105,9 @@ CAPTURE_DIR="$TESTS_DIR/captures/" $TSHARK -v | grep -q "with Lua" HAVE_LUA=$? +HAVE_ICONV="False" +hash iconv 2>/dev/null && HAVE_ICONV="True" + # Display our environment ##printf "\n ------- Info =-----------------\n" 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 } |