added more address utility function tests

This commit is contained in:
Arvid Norberg 2007-09-24 18:58:25 +00:00
parent 020902ac4c
commit 01112ab517
1 changed files with 9 additions and 3 deletions

View File

@ -184,9 +184,15 @@ int test_main()
// test network functions
TEST_CHECK(is_local(address::from_string("192.168.0.1")));
TEST_CHECK(is_local(address::from_string("10.1.1.56")));
TEST_CHECK(!is_local(address::from_string("14.14.251.63")));
asio::error_code ec;
TEST_CHECK(is_local(address::from_string("192.168.0.1", ec)));
TEST_CHECK(is_local(address::from_string("10.1.1.56", ec)));
TEST_CHECK(!is_local(address::from_string("14.14.251.63", ec)));
TEST_CHECK(is_loopback(address::from_string("127.0.0.1", ec)));
TEST_CHECK(is_loopback(address::from_string("::1", ec)));
TEST_CHECK(is_any(address_v6::any()));
TEST_CHECK(is_any(address_v4::any()));
TEST_CHECK(!is_any(address::from_string("31.53.21.64", ec)));
// test torrent parsing