mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 23:03:45 +01:00
Make G_FUZZING constexpr, require -DBUILD_FOR_FUZZING=ON to execute a fuzz target
This commit is contained in:
@@ -102,8 +102,6 @@ void ResetCoverageCounters() {}
|
||||
|
||||
void initialize()
|
||||
{
|
||||
g_fuzzing = true;
|
||||
|
||||
// By default, make the RNG deterministic with a fixed seed. This will affect all
|
||||
// randomness during the fuzz test, except:
|
||||
// - GetStrongRandBytes(), which is used for the creation of private key material.
|
||||
@@ -156,6 +154,10 @@ void initialize()
|
||||
std::cerr << "No fuzz target compiled for " << g_fuzz_target << "." << std::endl;
|
||||
std::exit(EXIT_FAILURE);
|
||||
}
|
||||
if constexpr (!G_FUZZING) {
|
||||
std::cerr << "Must compile with -DBUILD_FOR_FUZZING=ON to execute a fuzz target." << std::endl;
|
||||
std::exit(EXIT_FAILURE);
|
||||
}
|
||||
Assert(!g_test_one_input);
|
||||
g_test_one_input = &it->second.test_one_input;
|
||||
it->second.opts.init();
|
||||
|
||||
Reference in New Issue
Block a user