Skip to content

Commit 90b635e

Browse files
tests: Add fuzzing coverage for CHECK_NONFATAL(...)
1 parent a4e3d13 commit 90b635e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/test/fuzz/integer.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#include <test/fuzz/FuzzedDataProvider.h>
2525
#include <test/fuzz/fuzz.h>
2626
#include <test/fuzz/util.h>
27-
#include <time.h>
2827
#include <uint256.h>
28+
#include <util/check.h>
2929
#include <util/moneystr.h>
3030
#include <util/strencodings.h>
3131
#include <util/string.h>
@@ -35,6 +35,7 @@
3535

3636
#include <cassert>
3737
#include <chrono>
38+
#include <ctime>
3839
#include <limits>
3940
#include <set>
4041
#include <vector>
@@ -287,8 +288,12 @@ void test_one_input(const std::vector<uint8_t>& buffer)
287288
try {
288289
const uint64_t deserialized_u64 = ReadCompactSize(stream);
289290
assert(u64 == deserialized_u64 && stream.empty());
291+
} catch (const std::ios_base::failure&) {
290292
}
291-
catch (const std::ios_base::failure&) {
292-
}
293+
}
294+
295+
try {
296+
CHECK_NONFATAL(b);
297+
} catch (const NonFatalCheckError&) {
293298
}
294299
}

0 commit comments

Comments
 (0)