net: Have LookupNumeric return a CService directly

This commit is contained in:
Cory Fields
2016-08-04 16:37:49 -04:00
committed by lateminer
parent 327528fbf1
commit 84a208b9d2
8 changed files with 18 additions and 21 deletions

View File

@@ -86,9 +86,7 @@ BOOST_AUTO_TEST_CASE(netbase_splithost)
bool static TestParse(string src, string canon)
{
CService addr;
if (!LookupNumeric(src.c_str(), addr, 65535))
return canon == "";
CService addr(LookupNumeric(src.c_str(), 65535));
return canon == addr.ToString();
}
@@ -100,7 +98,7 @@ BOOST_AUTO_TEST_CASE(netbase_lookupnumeric)
BOOST_CHECK(TestParse("::", "[::]:65535"));
BOOST_CHECK(TestParse("[::]:8333", "[::]:8333"));
BOOST_CHECK(TestParse("[127.0.0.1]", "127.0.0.1:65535"));
BOOST_CHECK(TestParse(":::", ""));
BOOST_CHECK(TestParse(":::", "[::]:0"));
}
BOOST_AUTO_TEST_CASE(onioncat_test)