aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite-unittests.sh
diff options
context:
space:
mode:
authorHadriel Kaplan <hadrielk@yahoo.com>2014-02-02 22:49:30 -0500
committerEvan Huus <eapache@gmail.com>2014-02-04 00:37:46 +0000
commit2e7f771a182df815e8c3d38986a1df0c77d7e4aa (patch)
tree7e0fb8f65c75c19788fb3af273ec9228e696206e /test/suite-unittests.sh
parentcaed2818c94312d5df5d66fa20c6bba28fd49499 (diff)
Adds support for Lua Int64 and UInt64 operators, functions, and general
usefulness, working around bug #9162 until Lua 5.3 is released. The existing Int64 and UInt64 classes provide virtually no usefullness, other than for creating a string of their value. While one could then write Lua code to convert the string to Lua numbers and such, ultimately Lua has no native 64-bit integer support, making such a task difficult to handle in Lua. This change adds a host of functions and operators to the existing Int64 (gint64) and UInt64 (guint64) classes, to enable true 64-bit integer support on par with native Lua numbers. A test script is also provided, which tests the functions/operators. Change-Id: I4c5f8f5219b9a88198902283bd32ddf24c346bbe Reviewed-on: https://code.wireshark.org/review/83 Tested-by: Evan Huus <eapache@gmail.com> Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'test/suite-unittests.sh')
-rwxr-xr-xtest/suite-unittests.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/suite-unittests.sh b/test/suite-unittests.sh
index 7883aa3104..f10c65a00a 100755
--- a/test/suite-unittests.sh
+++ b/test/suite-unittests.sh
@@ -69,6 +69,17 @@ unittests_step_exntest() {
unittests_step_test
}
+unittests_step_lua_int64_test() {
+ $TSHARK -r $CAPTURE_DIR/dhcp.pcap -X lua_script:$TESTS_DIR/lua/int64.lua > testout.txt 2>&1
+ # Tshark catches lua script failures, so we have to parse the output.
+ if grep -q "All tests passed!" testout.txt; then
+ test_step_ok
+ else
+ cat testout.txt
+ test_step_failed "didn't find pass marker"
+ fi
+}
+
unittests_step_oids_test() {
DUT=$SOURCE_DIR/epan/oids_test
ARGS=
@@ -101,6 +112,7 @@ unittests_suite() {
test_step_set_pre unittests_cleanup_step
test_step_set_post unittests_cleanup_step
test_step_add "exntest" unittests_step_exntest
+ test_step_add "lua int64" unittests_step_lua_int64_test
test_step_add "oids_test" unittests_step_oids_test
test_step_add "reassemble_test" unittests_step_reassemble_test
test_step_add "tvbtest" unittests_step_tvbtest