fuzz: Avoid timeout in bitdeque fuzz target

This commit is contained in:
MacroFake 2022-09-05 15:53:08 +02:00
parent e864f2e4af
commit fa642286b8
No known key found for this signature in database
GPG key ID: CE2B75697E69A548

View file

@ -2,11 +2,10 @@
// Distributed under the MIT software license, see the accompanying // Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <util/bitdeque.h>
#include <random.h> #include <random.h>
#include <test/fuzz/FuzzedDataProvider.h> #include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/util.h> #include <test/fuzz/util.h>
#include <util/bitdeque.h>
#include <deque> #include <deque>
#include <vector> #include <vector>
@ -54,7 +53,8 @@ FUZZ_TARGET_INIT(bitdeque, InitRandData)
--initlen; --initlen;
} }
while (provider.remaining_bytes()) { LIMITED_WHILE(provider.remaining_bytes() > 0, 900)
{
{ {
assert(deq.size() == bitdeq.size()); assert(deq.size() == bitdeq.size());
auto it = deq.begin(); auto it = deq.begin();
@ -538,5 +538,4 @@ FUZZ_TARGET_INIT(bitdeque, InitRandData)
} }
); );
} }
} }