diff --git a/tests/t/36filter-area-my-friend.t b/tests/t/36filter-area-my-friend.t index e6e74a8..81a35a1 100644 --- a/tests/t/36filter-area-my-friend.t +++ b/tests/t/36filter-area-my-friend.t @@ -3,7 +3,7 @@ # use Test; -BEGIN { plan tests => 6 + 4 + 1 }; +BEGIN { plan tests => 6 + 4 + 2 + 1 }; use runproduct; use istest; use Ham::APRS::IS; @@ -15,12 +15,13 @@ ok(defined $p, 1, "Failed to initialize product runner"); ok($p->start(), 1, "Failed to start product"); my $login = "N5CAL-1"; +my $rxlogin = "N5CAL-2"; my $server_call = "TESTING"; my $i_tx = new Ham::APRS::IS("localhost:55580", $login); ok(defined $i_tx, 1, "Failed to initialize Ham::APRS::IS"); # allow range, then drop using a buddy filter -my $i_rx = new Ham::APRS::IS("localhost:55581", "N5CAL-2"); +my $i_rx = new Ham::APRS::IS("localhost:55581", $rxlogin); ok(defined $i_rx, 1, "Failed to initialize Ham::APRS::IS"); my $ret; @@ -32,6 +33,7 @@ ok($ret, 1, "Failed to connect to the server: " . $i_rx->{'error'}); my($tx, $rx, $helper); +############################################### # filter for area in north-east $i_rx->sendline("#filter a/60.1874/24.8362/60.1872/24.8365"); sleep(0.5); @@ -56,6 +58,23 @@ $pass = "PU2TFG-15>BEACON,qAR,PY2PE-1:Rede Brasileira de APRS - Aluminio/SP"; $drop = "DR0P-15>APN390,qAR,PY2PE-1:!2334.10S/04719.70E# drop east"; istest::should_drop(\&ok, $i_tx, $i_rx, $drop, $pass); +############################################### +# filter for range around my position, and transmit my position too +# also set a filter for friend range (it's position is already known +# from previous test) +$i_rx->sendline("#filter m/1 f/OH2TI/10"); +$i_rx->sendline("$rxlogin>APRS:!/0%yL_"); +sleep(0.5); + +$pass = "T3ST>APRS,qAR,$login:!/0%yL_ test"; # the same position... +$drop = "DR0P-15>APN390,qAR,$login:!2334.10S/04719.70E#"; +istest::should_drop(\&ok, $i_tx, $i_rx, $drop, $pass); + +# OH2TI is close enough to OH2TI, OH2FOI is not. +$pass = "OH1UK>APRS,TCPIP*,qAC,T2FINLAND:;OH2TA *101302z6014.89N/02447.00Ey"; +$drop = "OH2FOI>APRS,qAR,$login:!6013.90N/02500.05E-"; +istest::should_drop(\&ok, $i_tx, $i_rx, $drop, $pass); + # stop ok($p->stop(), 1, "Failed to stop product");