mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
Make G_FUZZING constexpr, require -DBUILD_FOR_FUZZING=ON to execute a fuzz target
This commit is contained in:
parent
fae3cf0ffa
commit
fafbf8acf4
5 changed files with 17 additions and 7 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue