aboutsummaryrefslogtreecommitdiff
path: root/src/test/addrman_tests.cpp
diff options
context:
space:
mode:
authorjosibake <josibake@protonmail.com>2021-12-14 12:55:50 +0100
committerjosibake <josibake@protonmail.com>2021-12-15 13:19:19 +0100
commitbf4f8171352e9b384b42c91da61dfc9c3ca89ed8 (patch)
tree2fca106d40fbce4b71a61a0eb16085440f0f9dfb /src/test/addrman_tests.cpp
parent5a64dc018c04ce16202a8e58ce92d2657c0b1806 (diff)
refactor: addrman_select test
Check that `Good()` is successful whenever it is called.
Diffstat (limited to 'src/test/addrman_tests.cpp')
-rw-r--r--src/test/addrman_tests.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/addrman_tests.cpp b/src/test/addrman_tests.cpp
index 226c4d6eec..cecc4c12e7 100644
--- a/src/test/addrman_tests.cpp
+++ b/src/test/addrman_tests.cpp
@@ -194,7 +194,7 @@ BOOST_AUTO_TEST_CASE(addrman_select)
BOOST_CHECK_EQUAL(addr_ret1.ToString(), "250.1.1.1:8333");
// Test: move addr to tried, select from new expected nothing returned.
- addrman.Good(CAddress(addr1, NODE_NONE));
+ BOOST_CHECK(addrman.Good(CAddress(addr1, NODE_NONE)));
BOOST_CHECK_EQUAL(addrman.size(), 1U);
auto addr_ret2 = addrman.Select(newOnly).first;
BOOST_CHECK_EQUAL(addr_ret2.ToString(), "[::]:0");
@@ -220,11 +220,11 @@ BOOST_AUTO_TEST_CASE(addrman_select)
CService addr7 = ResolveService("250.4.6.6", 8333);
BOOST_CHECK(addrman.Add({CAddress(addr5, NODE_NONE)}, ResolveService("250.3.1.1", 8333)));
- addrman.Good(CAddress(addr5, NODE_NONE));
+ BOOST_CHECK(addrman.Good(CAddress(addr5, NODE_NONE)));
BOOST_CHECK(addrman.Add({CAddress(addr6, NODE_NONE)}, ResolveService("250.3.1.1", 8333)));
- addrman.Good(CAddress(addr6, NODE_NONE));
+ BOOST_CHECK(addrman.Good(CAddress(addr6, NODE_NONE)));
BOOST_CHECK(addrman.Add({CAddress(addr7, NODE_NONE)}, ResolveService("250.1.1.3", 8333)));
- addrman.Good(CAddress(addr7, NODE_NONE));
+ BOOST_CHECK(addrman.Good(CAddress(addr7, NODE_NONE)));
// Test: 6 addrs + 1 addr from last test = 7.
BOOST_CHECK_EQUAL(addrman.size(), 7U);