File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -104,10 +104,14 @@ BOOST_AUTO_TEST_CASE(addrman_simple)
104
104
105
105
106
106
// Test: New table has one addr and we add a diff addr we should
107
- // have two addrs.
107
+ // have at least one addr.
108
+ // Note that addrman's size cannot be tested reliably after insertion, as
109
+ // hash collisions may occur. But we can always be sure of at least one
110
+ // success.
111
+
108
112
CService addr2 = ResolveService (" 250.1.1.2" , 8333 );
109
113
BOOST_CHECK (addrman.Add (CAddress (addr2, NODE_NONE), source));
110
- BOOST_CHECK_EQUAL (addrman.size (), 2 );
114
+ BOOST_CHECK (addrman.size () >= 1 );
111
115
112
116
// Test: AddrMan::Clear() should empty the new table.
113
117
addrman.Clear ();
@@ -120,7 +124,7 @@ BOOST_AUTO_TEST_CASE(addrman_simple)
120
124
vAddr.push_back (CAddress (ResolveService (" 250.1.1.3" , 8333 ), NODE_NONE));
121
125
vAddr.push_back (CAddress (ResolveService (" 250.1.1.4" , 8333 ), NODE_NONE));
122
126
BOOST_CHECK (addrman.Add (vAddr, source));
123
- BOOST_CHECK_EQUAL (addrman.size (), 2 );
127
+ BOOST_CHECK (addrman.size () >= 1 );
124
128
}
125
129
126
130
BOOST_AUTO_TEST_CASE (addrman_ports)
You can’t perform that action at this time.
0 commit comments