diff options
author | Cory Fields <cory-nospam-@coryfields.com> | 2016-08-04 16:37:49 -0400 |
---|---|---|
committer | Cory Fields <cory-nospam-@coryfields.com> | 2016-08-04 16:41:39 -0400 |
commit | 8945384bca00f74ba85c98a52925c254c49025a5 (patch) | |
tree | c5479d77e5feb28ed75b53715073bcf3b46c1ffe /src/test | |
parent | 21ba407a7369a0229b8a8554dee0da63a64e6639 (diff) |
net: Have LookupNumeric return a CService directly
Also fix up a few small issues:
- Lookup with "badip:port" now sets the port to 0
- Don't allow assert to have side-effects
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/netbase_tests.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/test/netbase_tests.cpp b/src/test/netbase_tests.cpp index 7a8584f0f4..18ad5dc90b 100644 --- a/src/test/netbase_tests.cpp +++ b/src/test/netbase_tests.cpp @@ -93,9 +93,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(); } @@ -107,7 +105,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) |