aboutsummaryrefslogtreecommitdiff
path: root/src/test/addrman_tests.cpp
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2019-12-29 20:23:48 +0000
committerpracticalswift <practicalswift@users.noreply.github.com>2020-01-08 12:35:59 +0000
commit7a046cdc1423963bdcbcf9bb98560af61fa90b37 (patch)
treeb06d88144cab5c18c45b06592d28ce237bd9a16f /src/test/addrman_tests.cpp
parentfefb9165f23fe9d10ad092ec31715f906e0d2ee7 (diff)
tests: Avoid using C-style NUL-terminated strings as arguments
Diffstat (limited to 'src/test/addrman_tests.cpp')
-rw-r--r--src/test/addrman_tests.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/test/addrman_tests.cpp b/src/test/addrman_tests.cpp
index c034216bc1..f44ed712d9 100644
--- a/src/test/addrman_tests.cpp
+++ b/src/test/addrman_tests.cpp
@@ -59,29 +59,20 @@ public:
}
};
-static CNetAddr ResolveIP(const char* ip)
+static CNetAddr ResolveIP(const std::string& ip)
{
CNetAddr addr;
BOOST_CHECK_MESSAGE(LookupHost(ip, addr, false), strprintf("failed to resolve: %s", ip));
return addr;
}
-static CNetAddr ResolveIP(std::string ip)
-{
- return ResolveIP(ip.c_str());
-}
-
-static CService ResolveService(const char* ip, int port = 0)
+static CService ResolveService(const std::string& ip, const int port = 0)
{
CService serv;
BOOST_CHECK_MESSAGE(Lookup(ip, serv, port, false), strprintf("failed to resolve: %s:%i", ip, port));
return serv;
}
-static CService ResolveService(std::string ip, int port = 0)
-{
- return ResolveService(ip.c_str(), port);
-}
BOOST_FIXTURE_TEST_SUITE(addrman_tests, BasicTestingSetup)