From fdef8bbf2f824a87f70b755155e9e1a8cd19fdcb Mon Sep 17 00:00:00 2001 From: practicalswift Date: Wed, 16 Oct 2019 20:38:53 +0000 Subject: tests: Allow for using non-default fuzzing initialization --- src/test/fuzz/fuzz.cpp | 4 +++- src/test/fuzz/fuzz.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/fuzz/fuzz.cpp b/src/test/fuzz/fuzz.cpp index cfa160dde2..a8a108cd18 100644 --- a/src/test/fuzz/fuzz.cpp +++ b/src/test/fuzz/fuzz.cpp @@ -22,7 +22,9 @@ static bool read_stdin(std::vector& data) return length == 0; } -static void initialize() +// Default initialization: Override using a non-weak initialize(). +__attribute__((weak)) +void initialize() { const static auto verify_handle = MakeUnique(); } diff --git a/src/test/fuzz/fuzz.h b/src/test/fuzz/fuzz.h index 573bd572db..3be202b16e 100644 --- a/src/test/fuzz/fuzz.h +++ b/src/test/fuzz/fuzz.h @@ -8,7 +8,7 @@ #include #include - +void initialize(); void test_one_input(const std::vector& buffer); #endif // BITCOIN_TEST_FUZZ_FUZZ_H -- cgit v1.2.3