Merge bitcoin/bitcoin#28065: fuzz: Flatten all FUZZ_TARGET macros into one

fa6dfaaf45 scripted-diff: Use new FUZZ_TARGET macro everywhere (MarcoFalke)
fa36ad8b09 fuzz: 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:
    ACK fa6dfaaf45

Tree-SHA512: 49a34553867a1734ce89e616b2d7c29b784a67cd8990db6573f0c7b18957636ef0c81d3d0d444a04c12cdc98bc4c4aa7a2ec94e6232dc363620a746e28416444
This commit is contained in:
fanquake
2023-07-17 13:18:27 +01:00
48 changed files with 87 additions and 82 deletions

View File

@@ -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));