diff options
author | Hadriel Kaplan <hadrielk@yahoo.com> | 2014-04-12 23:20:15 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-04-17 14:04:19 +0000 |
commit | f52626cc83fa6362a286f3ffbda1d3d67392ac3f (patch) | |
tree | 3db5bc96ff71bdab2ebc881b3a54d70e868acc3f /test/suite-wslua.sh | |
parent | c49be78f4e34124b64479aaaf6877f5839374305 (diff) |
Add tvb_get and proto_tree_add for string-encoded byte arrays
This commit adds tvb_get_string_bytes and proto_tree_add_bytes_item routines for
getting GByteArrays fields from the tvb when they are encoded in ASCII hex string form.
The proto_tree_add_bytes_item routine is also usable for normal
binary encoded byte arrays, and has the advantage of retrieving
the array values even if there's no proto tree.
It also exposes the routines to Lua, both so that a Lua script can take
advantage of this, but also so I can write a testsuite to test the functions.
Change-Id: I112a038653df6482a5d0ebe7c95708f207319e20
Reviewed-on: https://code.wireshark.org/review/1158
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'test/suite-wslua.sh')
-rwxr-xr-x | test/suite-wslua.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/suite-wslua.sh b/test/suite-wslua.sh index fdeb5f0f2f..04e7a70ca3 100755 --- a/test/suite-wslua.sh +++ b/test/suite-wslua.sh @@ -371,6 +371,14 @@ wslua_step_tvb_test() { fi # Tshark catches lua script failures, so we have to parse the output. + # perform this twice: once with a tree, once without + $TSHARK -r $CAPTURE_DIR/dns_port.pcap -X lua_script:$TESTS_DIR/lua/tvb.lua -V > testout.txt 2>&1 + grep -q "All tests passed!" testout.txt + if [ $? -ne 0 ]; then + cat testout.txt + test_step_failed "lua_args_test test 1 failed" + fi + $TSHARK -r $CAPTURE_DIR/dns_port.pcap -X lua_script:$TESTS_DIR/lua/tvb.lua > testout.txt 2>&1 if grep -q "All tests passed!" testout.txt; then test_step_ok |