mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Merge bitcoin/bitcoin#28065: fuzz: Flatten all FUZZ_TARGET macros into one
fa6dfaaf45scripted-diff: Use new FUZZ_TARGET macro everywhere (MarcoFalke)fa36ad8b09fuzz: Accept options in FUZZ_TARGET macro (MarcoFalke) Pull request description: The `FUZZ_TARGET` macros have many issues: * The developer will have to pick the right macro to pass the wanted option. * Adding a new option requires doubling the number of existing macros in the worst case. Fix all issues by using only a single macro. This refactor does not change behavior. ACKs for top commit: dergoegge: ACKfa6dfaaf45Tree-SHA512: 49a34553867a1734ce89e616b2d7c29b784a67cd8990db6573f0c7b18957636ef0c81d3d0d444a04c12cdc98bc4c4aa7a2ec94e6232dc363620a746e28416444
This commit is contained in:
@@ -46,7 +46,7 @@ void initialize_addrman()
|
||||
return NetGroupManager(asmap);
|
||||
}
|
||||
|
||||
FUZZ_TARGET_INIT(data_stream_addr_man, initialize_addrman)
|
||||
FUZZ_TARGET(data_stream_addr_man, .init = initialize_addrman)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
CDataStream data_stream = ConsumeDataStream(fuzzed_data_provider);
|
||||
@@ -233,7 +233,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
FUZZ_TARGET_INIT(addrman, initialize_addrman)
|
||||
FUZZ_TARGET(addrman, .init = initialize_addrman)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
SetMockTime(ConsumeTime(fuzzed_data_provider));
|
||||
@@ -319,7 +319,7 @@ FUZZ_TARGET_INIT(addrman, initialize_addrman)
|
||||
}
|
||||
|
||||
// Check that serialize followed by unserialize produces the same addrman.
|
||||
FUZZ_TARGET_INIT(addrman_serdeser, initialize_addrman)
|
||||
FUZZ_TARGET(addrman_serdeser, .init = initialize_addrman)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||
SetMockTime(ConsumeTime(fuzzed_data_provider));
|
||||
|
||||
Reference in New Issue
Block a user