@@ -26,7 +26,7 @@ class AddrManTest : public AddrMan
26
26
{
27
27
public:
28
28
explicit AddrManTest (std::vector<bool > asmap = std::vector<bool >())
29
- : AddrMan(asmap, /* deterministic=*/ true , /* consistency_check_ratio */ 100 )
29
+ : AddrMan(asmap, /* deterministic=*/ true , /* consistency_check_ratio= */ 100 )
30
30
{}
31
31
32
32
AddrInfo* Find (const CService& addr)
@@ -376,7 +376,7 @@ BOOST_AUTO_TEST_CASE(addrman_getaddr)
376
376
// Test: Sanity check, GetAddr should never return anything if addrman
377
377
// is empty.
378
378
BOOST_CHECK_EQUAL (addrman.size (), 0U );
379
- std::vector<CAddress> vAddr1 = addrman.GetAddr (/* max_addresses */ 0 , /* max_pct */ 0 , /* network */ std::nullopt);
379
+ std::vector<CAddress> vAddr1 = addrman.GetAddr (/* max_addresses= */ 0 , /* max_pct= */ 0 , /* network= */ std::nullopt);
380
380
BOOST_CHECK_EQUAL (vAddr1.size (), 0U );
381
381
382
382
CAddress addr1 = CAddress (ResolveService (" 250.250.2.1" , 8333 ), NODE_NONE);
@@ -396,15 +396,15 @@ BOOST_AUTO_TEST_CASE(addrman_getaddr)
396
396
BOOST_CHECK (addrman.Add ({addr1, addr3, addr5}, source1));
397
397
BOOST_CHECK (addrman.Add ({addr2, addr4}, source2));
398
398
399
- BOOST_CHECK_EQUAL (addrman.GetAddr (/* max_addresses */ 0 , /* max_pct */ 0 , /* network */ std::nullopt).size (), 5U );
399
+ BOOST_CHECK_EQUAL (addrman.GetAddr (/* max_addresses= */ 0 , /* max_pct= */ 0 , /* network= */ std::nullopt).size (), 5U );
400
400
// Net processing asks for 23% of addresses. 23% of 5 is 1 rounded down.
401
- BOOST_CHECK_EQUAL (addrman.GetAddr (/* max_addresses */ 2500 , /* max_pct */ 23 , /* network */ std::nullopt).size (), 1U );
401
+ BOOST_CHECK_EQUAL (addrman.GetAddr (/* max_addresses= */ 2500 , /* max_pct= */ 23 , /* network= */ std::nullopt).size (), 1U );
402
402
403
403
// Test: Ensure GetAddr works with new and tried addresses.
404
404
addrman.Good (CAddress (addr1, NODE_NONE));
405
405
addrman.Good (CAddress (addr2, NODE_NONE));
406
- BOOST_CHECK_EQUAL (addrman.GetAddr (/* max_addresses */ 0 , /* max_pct */ 0 , /* network */ std::nullopt).size (), 5U );
407
- BOOST_CHECK_EQUAL (addrman.GetAddr (/* max_addresses */ 2500 , /* max_pct */ 23 , /* network */ std::nullopt).size (), 1U );
406
+ BOOST_CHECK_EQUAL (addrman.GetAddr (/* max_addresses= */ 0 , /* max_pct= */ 0 , /* network= */ std::nullopt).size (), 5U );
407
+ BOOST_CHECK_EQUAL (addrman.GetAddr (/* max_addresses= */ 2500 , /* max_pct= */ 23 , /* network= */ std::nullopt).size (), 1U );
408
408
409
409
// Test: Ensure GetAddr still returns 23% when addrman has many addrs.
410
410
for (unsigned int i = 1 ; i < (8 * 256 ); i++) {
@@ -419,7 +419,7 @@ BOOST_AUTO_TEST_CASE(addrman_getaddr)
419
419
if (i % 8 == 0 )
420
420
addrman.Good (addr);
421
421
}
422
- std::vector<CAddress> vAddr = addrman.GetAddr (/* max_addresses */ 2500 , /* max_pct */ 23 , /* network */ std::nullopt);
422
+ std::vector<CAddress> vAddr = addrman.GetAddr (/* max_addresses= */ 2500 , /* max_pct= */ 23 , /* network= */ std::nullopt);
423
423
424
424
size_t percent23 = (addrman.size () * 23 ) / 100 ;
425
425
BOOST_CHECK_EQUAL (vAddr.size (), percent23);
@@ -973,7 +973,7 @@ BOOST_AUTO_TEST_CASE(load_addrman)
973
973
// Test that the de-serialization does not throw an exception.
974
974
CDataStream ssPeers1 = AddrmanToStream (addrman);
975
975
bool exceptionThrown = false ;
976
- AddrMan addrman1 (/* asmap */ std::vector<bool >(), /* deterministic */ false , /* consistency_check_ratio */ 100 );
976
+ AddrMan addrman1 (/* asmap= */ std::vector<bool >(), /* deterministic= */ false , /* consistency_check_ratio= */ 100 );
977
977
978
978
BOOST_CHECK (addrman1.size () == 0 );
979
979
try {
@@ -990,7 +990,7 @@ BOOST_AUTO_TEST_CASE(load_addrman)
990
990
// Test that ReadFromStream creates an addrman with the correct number of addrs.
991
991
CDataStream ssPeers2 = AddrmanToStream (addrman);
992
992
993
- AddrMan addrman2 (/* asmap */ std::vector<bool >(), /* deterministic */ false , /* consistency_check_ratio */ 100 );
993
+ AddrMan addrman2 (/* asmap= */ std::vector<bool >(), /* deterministic= */ false , /* consistency_check_ratio= */ 100 );
994
994
BOOST_CHECK (addrman2.size () == 0 );
995
995
ReadFromStream (addrman2, ssPeers2);
996
996
BOOST_CHECK (addrman2.size () == 3 );
@@ -1028,7 +1028,7 @@ BOOST_AUTO_TEST_CASE(load_addrman_corrupted)
1028
1028
// Test that the de-serialization of corrupted peers.dat throws an exception.
1029
1029
CDataStream ssPeers1 = MakeCorruptPeersDat ();
1030
1030
bool exceptionThrown = false ;
1031
- AddrMan addrman1 (/* asmap */ std::vector<bool >(), /* deterministic */ false , /* consistency_check_ratio */ 100 );
1031
+ AddrMan addrman1 (/* asmap= */ std::vector<bool >(), /* deterministic= */ false , /* consistency_check_ratio= */ 100 );
1032
1032
BOOST_CHECK (addrman1.size () == 0 );
1033
1033
try {
1034
1034
unsigned char pchMsgTmp[4 ];
@@ -1044,7 +1044,7 @@ BOOST_AUTO_TEST_CASE(load_addrman_corrupted)
1044
1044
// Test that ReadFromStream fails if peers.dat is corrupt
1045
1045
CDataStream ssPeers2 = MakeCorruptPeersDat ();
1046
1046
1047
- AddrMan addrman2 (/* asmap */ std::vector<bool >(), /* deterministic */ false , /* consistency_check_ratio */ 100 );
1047
+ AddrMan addrman2 (/* asmap= */ std::vector<bool >(), /* deterministic= */ false , /* consistency_check_ratio= */ 100 );
1048
1048
BOOST_CHECK (addrman2.size () == 0 );
1049
1049
BOOST_CHECK_THROW (ReadFromStream (addrman2, ssPeers2), std::ios_base::failure);
1050
1050
}
0 commit comments