aboutsummaryrefslogtreecommitdiff
path: root/src/test/addrman_tests.cpp
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2021-11-01 15:33:19 +0000
committerJohn Newbery <john@johnnewbery.com>2021-11-09 17:09:50 +0000
commit7784a9a374ac34acb4656f740fecf4ae1743f73f (patch)
tree7c25b61871df8513fa0610cf38ba5195d0e8a90f /src/test/addrman_tests.cpp
parenta749fa539ae4330dd5d610286f418156e080e9dd (diff)
[addrman] [tests] Remove deterministic argument and member from AddrManTest
It's always set to true.
Diffstat (limited to 'src/test/addrman_tests.cpp')
-rw-r--r--src/test/addrman_tests.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/test/addrman_tests.cpp b/src/test/addrman_tests.cpp
index eabc11c467..f74906580f 100644
--- a/src/test/addrman_tests.cpp
+++ b/src/test/addrman_tests.cpp
@@ -79,15 +79,10 @@ static CDataStream AddrmanToStream(const AddrManSerializationMock& _addrman)
class AddrManTest : public AddrMan
{
-private:
- bool deterministic;
public:
- explicit AddrManTest(bool makeDeterministic = true,
- std::vector<bool> asmap = std::vector<bool>())
- : AddrMan(asmap, makeDeterministic, /* consistency_check_ratio */ 100)
- {
- deterministic = makeDeterministic;
- }
+ explicit AddrManTest(std::vector<bool> asmap = std::vector<bool>())
+ : AddrMan(asmap, /*deterministic=*/true, /* consistency_check_ratio */ 100)
+ {}
AddrInfo* Find(const CService& addr, int* pnId = nullptr)
{
@@ -760,8 +755,8 @@ BOOST_AUTO_TEST_CASE(addrman_serialization)
{
std::vector<bool> asmap1 = FromBytes(asmap_raw, sizeof(asmap_raw) * 8);
- auto addrman_asmap1 = std::make_unique<AddrManTest>(true, asmap1);
- auto addrman_asmap1_dup = std::make_unique<AddrManTest>(true, asmap1);
+ auto addrman_asmap1 = std::make_unique<AddrManTest>(asmap1);
+ auto addrman_asmap1_dup = std::make_unique<AddrManTest>(asmap1);
auto addrman_noasmap = std::make_unique<AddrManTest>();
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
@@ -792,7 +787,7 @@ BOOST_AUTO_TEST_CASE(addrman_serialization)
BOOST_CHECK(bucketAndEntry_asmap1.second != bucketAndEntry_noasmap.second);
// deserializing non-asmaped peers.dat to asmaped addrman
- addrman_asmap1 = std::make_unique<AddrManTest>(true, asmap1);
+ addrman_asmap1 = std::make_unique<AddrManTest>(asmap1);
addrman_noasmap = std::make_unique<AddrManTest>();
addrman_noasmap->Add({addr}, default_source);
stream << *addrman_noasmap;
@@ -804,7 +799,7 @@ BOOST_AUTO_TEST_CASE(addrman_serialization)
BOOST_CHECK(bucketAndEntry_asmap1_deser.second == bucketAndEntry_asmap1_dup.second);
// used to map to different buckets, now maps to the same bucket.
- addrman_asmap1 = std::make_unique<AddrManTest>(true, asmap1);
+ addrman_asmap1 = std::make_unique<AddrManTest>(asmap1);
addrman_noasmap = std::make_unique<AddrManTest>();
CAddress addr1 = CAddress(ResolveService("250.1.1.1"), NODE_NONE);
CAddress addr2 = CAddress(ResolveService("250.2.1.1"), NODE_NONE);