diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2020-04-22 13:57:15 +0000 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2020-04-26 20:23:56 +0000 |
commit | 90b635e84e432e5a3682864f15274dba6acfbded (patch) | |
tree | e719bcd2a0be64e43c25094bf103bef08c2dd8f9 /src/test/fuzz/integer.cpp | |
parent | a4e3d13df6a6f48974f541de0b5b061e8078ba9a (diff) |
tests: Add fuzzing coverage for CHECK_NONFATAL(...)
Diffstat (limited to 'src/test/fuzz/integer.cpp')
-rw-r--r-- | src/test/fuzz/integer.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/test/fuzz/integer.cpp b/src/test/fuzz/integer.cpp index 9dbf0fcc90..d5b5ec3c9a 100644 --- a/src/test/fuzz/integer.cpp +++ b/src/test/fuzz/integer.cpp @@ -24,8 +24,8 @@ #include <test/fuzz/FuzzedDataProvider.h> #include <test/fuzz/fuzz.h> #include <test/fuzz/util.h> -#include <time.h> #include <uint256.h> +#include <util/check.h> #include <util/moneystr.h> #include <util/strencodings.h> #include <util/string.h> @@ -35,6 +35,7 @@ #include <cassert> #include <chrono> +#include <ctime> #include <limits> #include <set> #include <vector> @@ -287,8 +288,12 @@ void test_one_input(const std::vector<uint8_t>& buffer) try { const uint64_t deserialized_u64 = ReadCompactSize(stream); assert(u64 == deserialized_u64 && stream.empty()); + } catch (const std::ios_base::failure&) { } - catch (const std::ios_base::failure&) { - } + } + + try { + CHECK_NONFATAL(b); + } catch (const NonFatalCheckError&) { } } |