fuzz: Speed up rolling_bloom_filter fuzz test

This commit is contained in:
MarcoFalke 2021-07-15 11:53:32 +02:00
parent 97153a7026
commit aaaa61fd30
No known key found for this signature in database
GPG key ID: CE2B75697E69A548

View file

@ -16,12 +16,16 @@
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());
CRollingBloomFilter rolling_bloom_filter{
fuzzed_data_provider.ConsumeIntegralInRange<unsigned int>(1, 1000),
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(
fuzzed_data_provider,
[&] {