mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-26 19:23:26 -03:00
fuzz: Speed up rolling_bloom_filter fuzz test
This commit is contained in:
parent
97153a7026
commit
aaaa61fd30
1 changed files with 5 additions and 1 deletions
|
@ -16,12 +16,16 @@
|
||||||
|
|
||||||
FUZZ_TARGET(rolling_bloom_filter)
|
FUZZ_TARGET(rolling_bloom_filter)
|
||||||
{
|
{
|
||||||
|
// Pick an arbitrary upper bound to limit the runtime and avoid timeouts on
|
||||||
|
// inputs.
|
||||||
|
int limit_max_ops{3000};
|
||||||
|
|
||||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||||
|
|
||||||
CRollingBloomFilter rolling_bloom_filter{
|
CRollingBloomFilter rolling_bloom_filter{
|
||||||
fuzzed_data_provider.ConsumeIntegralInRange<unsigned int>(1, 1000),
|
fuzzed_data_provider.ConsumeIntegralInRange<unsigned int>(1, 1000),
|
||||||
0.999 / fuzzed_data_provider.ConsumeIntegralInRange<unsigned int>(1, std::numeric_limits<unsigned int>::max())};
|
0.999 / fuzzed_data_provider.ConsumeIntegralInRange<unsigned int>(1, std::numeric_limits<unsigned int>::max())};
|
||||||
while (fuzzed_data_provider.remaining_bytes() > 0) {
|
while (--limit_max_ops >= 0 && fuzzed_data_provider.remaining_bytes() > 0) {
|
||||||
CallOneOf(
|
CallOneOf(
|
||||||
fuzzed_data_provider,
|
fuzzed_data_provider,
|
||||||
[&] {
|
[&] {
|
||||||
|
|
Loading…
Add table
Reference in a new issue