From d8b9cec25b1d851b711a76f08aed6bce9be933d4 Mon Sep 17 00:00:00 2001 From: Patrick Strateman Date: Sun, 20 Dec 2020 18:19:43 -0500 Subject: inline non-member functions with body in fuzzing headers --- src/test/fuzz/util.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/test/fuzz/util.h') diff --git a/src/test/fuzz/util.h b/src/test/fuzz/util.h index cf666a8b93..509864568d 100644 --- a/src/test/fuzz/util.h +++ b/src/test/fuzz/util.h @@ -249,7 +249,7 @@ template return result; } -CNetAddr ConsumeNetAddr(FuzzedDataProvider& fuzzed_data_provider) noexcept +inline CNetAddr ConsumeNetAddr(FuzzedDataProvider& fuzzed_data_provider) noexcept { const Network network = fuzzed_data_provider.PickValueInArray({Network::NET_IPV4, Network::NET_IPV6, Network::NET_INTERNAL, Network::NET_ONION}); CNetAddr net_addr; @@ -271,22 +271,22 @@ CNetAddr ConsumeNetAddr(FuzzedDataProvider& fuzzed_data_provider) noexcept return net_addr; } -CSubNet ConsumeSubNet(FuzzedDataProvider& fuzzed_data_provider) noexcept +inline CSubNet ConsumeSubNet(FuzzedDataProvider& fuzzed_data_provider) noexcept { return {ConsumeNetAddr(fuzzed_data_provider), fuzzed_data_provider.ConsumeIntegral()}; } -CService ConsumeService(FuzzedDataProvider& fuzzed_data_provider) noexcept +inline CService ConsumeService(FuzzedDataProvider& fuzzed_data_provider) noexcept { return {ConsumeNetAddr(fuzzed_data_provider), fuzzed_data_provider.ConsumeIntegral()}; } -CAddress ConsumeAddress(FuzzedDataProvider& fuzzed_data_provider) noexcept +inline CAddress ConsumeAddress(FuzzedDataProvider& fuzzed_data_provider) noexcept { return {ConsumeService(fuzzed_data_provider), static_cast(fuzzed_data_provider.ConsumeIntegral()), fuzzed_data_provider.ConsumeIntegral()}; } -CNode ConsumeNode(FuzzedDataProvider& fuzzed_data_provider) noexcept +inline CNode ConsumeNode(FuzzedDataProvider& fuzzed_data_provider) noexcept { const NodeId node_id = fuzzed_data_provider.ConsumeIntegral(); const ServiceFlags local_services = static_cast(fuzzed_data_provider.ConsumeIntegral()); @@ -302,7 +302,7 @@ CNode ConsumeNode(FuzzedDataProvider& fuzzed_data_provider) noexcept return {node_id, local_services, my_starting_height, socket, address, keyed_net_group, local_host_nonce, addr_bind, addr_name, conn_type, inbound_onion}; } -void InitializeFuzzingContext(const std::string& chain_name = CBaseChainParams::REGTEST) +inline void InitializeFuzzingContext(const std::string& chain_name = CBaseChainParams::REGTEST) { static const BasicTestingSetup basic_testing_setup{chain_name, {"-nodebuglogfile"}}; } -- cgit v1.2.3