Changeset View
Changeset View
Standalone View
Standalone View
src/test/bloom_tests.cpp
Show First 20 Lines • Show All 1,090 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static std::vector<uint8_t> RandomData() { | static std::vector<uint8_t> RandomData() { | ||||
uint256 r = InsecureRand256(); | uint256 r = InsecureRand256(); | ||||
return std::vector<uint8_t>(r.begin(), r.end()); | return std::vector<uint8_t>(r.begin(), r.end()); | ||||
} | } | ||||
BOOST_AUTO_TEST_CASE(rolling_bloom) { | BOOST_AUTO_TEST_CASE(rolling_bloom) { | ||||
SeedInsecureRand(/* deterministic */ true); | SeedInsecureRand(SeedRand::ZEROS); | ||||
g_mock_deterministic_tests = true; | g_mock_deterministic_tests = true; | ||||
// last-100-entry, 1% false positive: | // last-100-entry, 1% false positive: | ||||
CRollingBloomFilter rb1(100, 0.01); | CRollingBloomFilter rb1(100, 0.01); | ||||
// Overfill: | // Overfill: | ||||
static const int DATASIZE = 399; | static const int DATASIZE = 399; | ||||
std::vector<uint8_t> data[DATASIZE]; | std::vector<uint8_t> data[DATASIZE]; | ||||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |