mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-06-02 15:32:34 +02:00
tests: Add fuzzing coverage for CHECK_NONFATAL(...)
This commit is contained in:
parent
a4e3d13df6
commit
90b635e84e
@ -24,8 +24,8 @@
|
|||||||
#include <test/fuzz/FuzzedDataProvider.h>
|
#include <test/fuzz/FuzzedDataProvider.h>
|
||||||
#include <test/fuzz/fuzz.h>
|
#include <test/fuzz/fuzz.h>
|
||||||
#include <test/fuzz/util.h>
|
#include <test/fuzz/util.h>
|
||||||
#include <time.h>
|
|
||||||
#include <uint256.h>
|
#include <uint256.h>
|
||||||
|
#include <util/check.h>
|
||||||
#include <util/moneystr.h>
|
#include <util/moneystr.h>
|
||||||
#include <util/strencodings.h>
|
#include <util/strencodings.h>
|
||||||
#include <util/string.h>
|
#include <util/string.h>
|
||||||
@ -35,6 +35,7 @@
|
|||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
#include <ctime>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -287,8 +288,12 @@ void test_one_input(const std::vector<uint8_t>& buffer)
|
|||||||
try {
|
try {
|
||||||
const uint64_t deserialized_u64 = ReadCompactSize(stream);
|
const uint64_t deserialized_u64 = ReadCompactSize(stream);
|
||||||
assert(u64 == deserialized_u64 && stream.empty());
|
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&) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user