|
|
@ -143,6 +143,17 @@ BOOST_AUTO_TEST_CASE(subnet_test) |
|
|
|
BOOST_CHECK(CSubNet("1:2:3:4:5:6:7:8/128").IsValid()); |
|
|
|
BOOST_CHECK(CSubNet("1:2:3:4:5:6:7:8/128").IsValid()); |
|
|
|
BOOST_CHECK(!CSubNet("1:2:3:4:5:6:7:8/129").IsValid()); |
|
|
|
BOOST_CHECK(!CSubNet("1:2:3:4:5:6:7:8/129").IsValid()); |
|
|
|
BOOST_CHECK(!CSubNet("fuzzy").IsValid()); |
|
|
|
BOOST_CHECK(!CSubNet("fuzzy").IsValid()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//CNetAddr constructor test
|
|
|
|
|
|
|
|
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.2"))); |
|
|
|
|
|
|
|
BOOST_CHECK(CSubNet(CNetAddr("127.0.0.1")).ToString() == "127.0.0.1/255.255.255.255"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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: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_AUTO_TEST_SUITE_END() |
|
|
|
BOOST_AUTO_TEST_SUITE_END() |
|
|
|