|
|
@ -149,12 +149,12 @@ BOOST_AUTO_TEST_CASE(subnet_test) |
|
|
|
BOOST_CHECK(CSubNet(CNetAddr("127.0.0.1")).IsValid()); |
|
|
|
BOOST_CHECK(CSubNet(CNetAddr("127.0.0.1")).IsValid()); |
|
|
|
BOOST_CHECK(CSubNet(CNetAddr("127.0.0.1")).Match(CNetAddr("127.0.0.1"))); |
|
|
|
BOOST_CHECK(CSubNet(CNetAddr("127.0.0.1")).Match(CNetAddr("127.0.0.1"))); |
|
|
|
BOOST_CHECK(!CSubNet(CNetAddr("127.0.0.1")).Match(CNetAddr("127.0.0.2"))); |
|
|
|
BOOST_CHECK(!CSubNet(CNetAddr("127.0.0.1")).Match(CNetAddr("127.0.0.2"))); |
|
|
|
BOOST_CHECK(CSubNet(CNetAddr("127.0.0.1")).ToString() == "127.0.0.1/255.255.255.255"); |
|
|
|
BOOST_CHECK(CSubNet(CNetAddr("127.0.0.1")).ToString() == "127.0.0.1/32"); |
|
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK(CSubNet(CNetAddr("1:2:3:4:5:6:7:8")).IsValid()); |
|
|
|
BOOST_CHECK(CSubNet(CNetAddr("1:2:3:4:5:6:7:8")).IsValid()); |
|
|
|
BOOST_CHECK(CSubNet(CNetAddr("1:2:3:4:5:6:7:8")).Match(CNetAddr("1:2:3:4:5:6:7:8"))); |
|
|
|
BOOST_CHECK(CSubNet(CNetAddr("1:2:3:4:5:6:7:8")).Match(CNetAddr("1:2:3:4:5:6:7:8"))); |
|
|
|
BOOST_CHECK(!CSubNet(CNetAddr("1:2:3:4:5:6:7:8")).Match(CNetAddr("1:2:3:4:5:6:7:9"))); |
|
|
|
BOOST_CHECK(!CSubNet(CNetAddr("1:2:3:4:5:6:7:8")).Match(CNetAddr("1:2:3:4:5:6:7:9"))); |
|
|
|
BOOST_CHECK(CSubNet(CNetAddr("1:2:3:4:5:6:7:8")).ToString() == "1:2:3:4:5:6:7:8/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"); |
|
|
|
BOOST_CHECK(CSubNet(CNetAddr("1:2:3:4:5:6:7:8")).ToString() == "1:2:3:4:5:6:7:8/128"); |
|
|
|
|
|
|
|
|
|
|
|
CSubNet subnet = CSubNet("1.2.3.4/255.255.255.255"); |
|
|
|
CSubNet subnet = CSubNet("1.2.3.4/255.255.255.255"); |
|
|
|
BOOST_CHECK_EQUAL(subnet.ToString(), "1.2.3.4/32"); |
|
|
|
BOOST_CHECK_EQUAL(subnet.ToString(), "1.2.3.4/32"); |
|
|
@ -233,8 +233,6 @@ BOOST_AUTO_TEST_CASE(subnet_test) |
|
|
|
BOOST_CHECK_EQUAL(subnet.ToString(), "1.2.0.0/255.255.232.0"); |
|
|
|
BOOST_CHECK_EQUAL(subnet.ToString(), "1.2.0.0/255.255.232.0"); |
|
|
|
subnet = CSubNet("1:2:3:4:5:6:7:8/ffff:ffff:ffff:fffe:ffff:ffff:ffff:ff0f"); |
|
|
|
subnet = CSubNet("1:2:3:4:5:6:7:8/ffff:ffff:ffff:fffe:ffff:ffff:ffff:ff0f"); |
|
|
|
BOOST_CHECK_EQUAL(subnet.ToString(), "1:2:3:4:5:6:7:8/ffff:ffff:ffff:fffe:ffff:ffff:ffff:ff0f"); |
|
|
|
BOOST_CHECK_EQUAL(subnet.ToString(), "1:2:3:4:5:6:7:8/ffff:ffff:ffff:fffe:ffff:ffff:ffff:ff0f"); |
|
|
|
subnet = CSubNet("1:2:3:4:5:6:7:8/fff:ffff:ffff:ffff:ffff:ffff:ffff:fff0"); |
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(subnet.ToString(), "1:2:3:4:5:6:7:0/fff:ffff:ffff:ffff:ffff:ffff:ffff:fff0"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(netbase_getgroup) |
|
|
|
BOOST_AUTO_TEST_CASE(netbase_getgroup) |
|
|
|