aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz/bitdeque.cpp
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-12-06 15:47:39 +0100
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-12-06 15:44:38 +0100
commitfad1903b8a85506378101c1f857ba47b4a058fb4 (patch)
treecaaa763333ba2e5c745607c25243eaf4f87514d4 /src/test/fuzz/bitdeque.cpp
parent6d5790956f45e3de5c6c4ee6fda21878b0d1287b (diff)
fuzz: Avoid timeout in bitdeque
Diffstat (limited to 'src/test/fuzz/bitdeque.cpp')
-rw-r--r--src/test/fuzz/bitdeque.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/test/fuzz/bitdeque.cpp b/src/test/fuzz/bitdeque.cpp
index 65f5cb3fd0..d5cc9cfd34 100644
--- a/src/test/fuzz/bitdeque.cpp
+++ b/src/test/fuzz/bitdeque.cpp
@@ -53,21 +53,11 @@ FUZZ_TARGET(bitdeque, .init = InitRandData)
--initlen;
}
- LIMITED_WHILE(provider.remaining_bytes() > 0, 900)
+ const auto iter_limit{maxlen > 6000 ? 90U : 900U};
+ LIMITED_WHILE(provider.remaining_bytes() > 0, iter_limit)
{
- {
- assert(deq.size() == bitdeq.size());
- auto it = deq.begin();
- auto bitit = bitdeq.begin();
- auto itend = deq.end();
- while (it != itend) {
- assert(*it == *bitit);
- ++it;
- ++bitit;
- }
- }
-
- CallOneOf(provider,
+ CallOneOf(
+ provider,
[&] {
// constructor()
deq = std::deque<bool>{};
@@ -535,7 +525,17 @@ FUZZ_TARGET(bitdeque, .init = InitRandData)
assert(it == deq.begin() + before);
assert(bitit == bitdeq.begin() + before);
}
- }
- );
+ });
+ }
+ {
+ assert(deq.size() == bitdeq.size());
+ auto it = deq.begin();
+ auto bitit = bitdeq.begin();
+ auto itend = deq.end();
+ while (it != itend) {
+ assert(*it == *bitit);
+ ++it;
+ ++bitit;
+ }
}
}