Skip to content

Commit fdef8bb

Browse files
tests: Allow for using non-default fuzzing initialization
1 parent c34b886 commit fdef8bb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/test/fuzz/fuzz.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ static bool read_stdin(std::vector<uint8_t>& data)
2222
return length == 0;
2323
}
2424

25-
static void initialize()
25+
// Default initialization: Override using a non-weak initialize().
26+
__attribute__((weak))
27+
void initialize()
2628
{
2729
const static auto verify_handle = MakeUnique<ECCVerifyHandle>();
2830
}

src/test/fuzz/fuzz.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <stdint.h>
99
#include <vector>
1010

11-
11+
void initialize();
1212
void test_one_input(const std::vector<uint8_t>& buffer);
1313

1414
#endif // BITCOIN_TEST_FUZZ_FUZZ_H

0 commit comments

Comments
 (0)