|
|
@ -302,4 +302,22 @@ BOOST_AUTO_TEST_CASE(netbase_getgroup)
|
|
|
|
BOOST_CHECK(CreateInternal("baz.net").GetGroup() == internal_group);
|
|
|
|
BOOST_CHECK(CreateInternal("baz.net").GetGroup() == internal_group);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(netbase_parsenetwork)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(ParseNetwork("ipv4"), NET_IPV4);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(ParseNetwork("ipv6"), NET_IPV6);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(ParseNetwork("onion"), NET_ONION);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(ParseNetwork("tor"), NET_ONION);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(ParseNetwork("IPv4"), NET_IPV4);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(ParseNetwork("IPv6"), NET_IPV6);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(ParseNetwork("ONION"), NET_ONION);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(ParseNetwork("TOR"), NET_ONION);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(ParseNetwork(":)"), NET_UNROUTABLE);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(ParseNetwork("tÖr"), NET_UNROUTABLE);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(ParseNetwork("\xfe\xff"), NET_UNROUTABLE);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(ParseNetwork(""), NET_UNROUTABLE);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_SUITE_END()
|
|
|
|
BOOST_AUTO_TEST_SUITE_END()
|
|
|
|