]> granicus.if.org Git - pdns/commitdiff
add a single-netmask long test case for netmasktree
authorbert hubert <bert.hubert@netherlabs.nl>
Sun, 29 Nov 2015 10:50:26 +0000 (11:50 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Sun, 29 Nov 2015 10:50:26 +0000 (11:50 +0100)
pdns/test-nmtree.cc

index 5cb758357b64961c84d8852cd8b10d4d89976dfb..2aaedf8f8dce390d6fa25f6e6462bb724a50a5ae 100644 (file)
@@ -46,6 +46,12 @@ BOOST_AUTO_TEST_CASE(test_basic) {
   BOOST_CHECK_EQUAL(nmt.lookup(ComboAddress("fe80::1"))->second, 2);
 }
 
+BOOST_AUTO_TEST_CASE(test_single) {
+  NetmaskTree<bool> nmt;
+  nmt.insert(Netmask("127.0.0.0/8")).second=1;
+  BOOST_CHECK_EQUAL(nmt.lookup(ComboAddress("127.0.0.1"))->second, 1);
+}
+
 BOOST_AUTO_TEST_CASE(test_scale) {
   string start="192.168.";
   NetmaskTree<int> works;