diff options
author | Carl Dong <contact@carldong.me> | 2021-01-15 15:31:50 -0500 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2021-01-21 09:29:42 -0500 |
commit | 713314abfa224efceb7ba6fa7fef37c449902936 (patch) | |
tree | 85337d14d14377aad511a7c7f04449bb5b1a4a58 /src/test/fuzz/load_external_block_file.cpp | |
parent | f91587f050d9dceb45fe10129a76a4a9a060a09c (diff) |
fuzz: Consolidate fuzzing TestingSetup initialization
Previously, the {Basic,}TestingSetup for fuzzers were set up in many ways:
1. Calling InitializeFuzzingContext, which implicitly constructs a static
const BasicTestingSetup
2. Directly constructing a static const BasicTestingSetup in the initialize_*
function
3. Directly constructing a static TestingSetup and reproducing the
initialization arguments (I'm assuming because
InitializeFuzzingContext only initializes a BasicTestingSetup)
The new, relatively-simple MakeFuzzingContext function allows us to
consolidate these methods of initialization by being flexible enough to
be used in all situations. It:
1. Is templated so that we can choose to initialize any of
the *TestingSetup classes
2. Has sane defaults which are often used in fuzzers but are also
easily overridable
3. Returns a unique_ptr, explicitly transferring ownership to the caller
to deal with according to its situation
Diffstat (limited to 'src/test/fuzz/load_external_block_file.cpp')
-rw-r--r-- | src/test/fuzz/load_external_block_file.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/fuzz/load_external_block_file.cpp b/src/test/fuzz/load_external_block_file.cpp index c428a86631..6e173908b9 100644 --- a/src/test/fuzz/load_external_block_file.cpp +++ b/src/test/fuzz/load_external_block_file.cpp @@ -15,7 +15,7 @@ void initialize_load_external_block_file() { - InitializeFuzzingContext(); + static const auto testing_setup = MakeFuzzingContext<>(); } FUZZ_TARGET_INIT(load_external_block_file, initialize_load_external_block_file) |