From 5f021c73f834f43bc7fab2aa19b6f36ad9120a81 Mon Sep 17 00:00:00 2001 From: Heikki Hannikainen Date: Tue, 9 Oct 2012 01:57:32 +0300 Subject: [PATCH] testing: test cases for dupecheck 8-bit mangling handling --- tests/t/10dupecheck.t | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/t/10dupecheck.t b/tests/t/10dupecheck.t index 7012876..7f2f34f 100644 --- a/tests/t/10dupecheck.t +++ b/tests/t/10dupecheck.t @@ -3,7 +3,7 @@ # use Test; -BEGIN { plan tests => 20 }; +BEGIN { plan tests => 20 + 4 }; use runproduct; use istest; use Ham::APRS::IS; @@ -97,6 +97,27 @@ istest::should_drop(\&ok, $i_tx, $i_rx, "SRC>DST2,DIGI1*,qAR,$login:xxx", "SRC>DST:dummy3", 1); # will pass (helper packet) +###### +# 17: send a packet with some 8-bit binary data, test that trimmed packets are dropped +istest::txrx(\&ok, $i_tx, $i_rx, + "SRC>DST2,qAR,$login:latin1 \xC5\xC4\xD6 skandit", + "SRC>DST2,qAR,$login:latin1 \xC5\xC4\xD6 skandit"); + +# 18: removed +istest::should_drop(\&ok, $i_tx, $i_rx, + "SRC>DST2,qAR,$login:latin1 skandit", + "SRC>DST:latin1 dummy1", 1); # will pass (helper packet) + +# 19: replaced with spaces +istest::should_drop(\&ok, $i_tx, $i_rx, + "SRC>DST2,qAR,$login:latin1 skandit", + "SRC>DST:latin1 dummy2", 1); # will pass (helper packet) + +# 20: 8th bit trimmed +istest::should_drop(\&ok, $i_tx, $i_rx, + "SRC>DST2,qAR,$login:latin1 \x45\x44\x56 skandit", + "SRC>DST:latin1 dummy3", 1); # will pass (helper packet) + # disconnect