diff options
Diffstat (limited to 'test/lua/tvb.lua')
-rw-r--r-- | test/lua/tvb.lua | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/lua/tvb.lua b/test/lua/tvb.lua index 43a042ee85..cfc068fcd6 100644 --- a/test/lua/tvb.lua +++ b/test/lua/tvb.lua @@ -54,7 +54,7 @@ end -- number of verifyFields() * (1 + number of fields) + -- number of verifyResults() * (1 + 2 * number of values) -- -local taptests = { [FRAME]=4, [OTHER]=330 } +local taptests = { [FRAME]=4, [OTHER]=333 } local function getResults() print("\n-----------------------------\n") @@ -166,6 +166,7 @@ local testfield = ABSOLUTE_UTC = ProtoField.absolute_time("test.basic.absolute.utc", "Basic absolute utc", base.UTC), IPv4 = ProtoField.ipv4 ("test.basic.ipv4", "Basic ipv4 address"), IPv6 = ProtoField.ipv6 ("test.basic.ipv6", "Basic ipv6 address"), + ETHER = ProtoField.ether ("test.basic.ether", "Basic ethernet address"), -- GUID = ProtoField.guid ("test.basic.guid", "Basic GUID"), }, @@ -216,6 +217,7 @@ local getfield = ABSOLUTE_UTC = Field.new ("test.basic.absolute.utc"), IPv4 = Field.new ("test.basic.ipv4"), IPv6 = Field.new ("test.basic.ipv6"), + ETHER = Field.new ("test.basic.ether"), -- GUID = Field.new ("test.basic.guid"), }, @@ -577,6 +579,18 @@ function test_proto.dissector(tvbuf,pktinfo,root) verifyFields("basic.IPv4", ipv4_match_fields) ---------------------------------------- + testing(OTHER, "tree:add ether") + + local tvb = ByteArray.new("010203040506"):tvb("Ether") + local ether = testfield.basic.ETHER + local ether_match_fields = {} + + execute ("ether", pcall (callTreeAdd, tree, ether, tvb:range(0,6))) + addMatchFields(ether_match_fields, Address.ether('01:02:03:04:05:06')) + + verifyFields("basic.ETHER", ether_match_fields) + +---------------------------------------- testing(OTHER, "tree:add_packet_field Bytes") resetResults() |