From e5b9ee0221ec8aa238fb5720fcd6faa01b09fe46 Mon Sep 17 00:00:00 2001 From: brunoerg Date: Wed, 3 Jan 2024 16:20:00 -0300 Subject: [PATCH] fuzz: set `nMaxOutboundLimit` in connman target --- src/test/fuzz/connman.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/test/fuzz/connman.cpp b/src/test/fuzz/connman.cpp index 24f91abd250fd..66f1e19b6515d 100644 --- a/src/test/fuzz/connman.cpp +++ b/src/test/fuzz/connman.cpp @@ -38,6 +38,10 @@ FUZZ_TARGET(connman, .init = initialize_connman) *g_setup->m_node.netgroupman, Params(), fuzzed_data_provider.ConsumeBool()}; + + const uint64_t max_outbound_limit{fuzzed_data_provider.ConsumeIntegral()}; + connman.Init({ .nMaxOutboundLimit = max_outbound_limit }); + CNetAddr random_netaddr; CNode random_node = ConsumeNode(fuzzed_data_provider); CSubNet random_subnet; @@ -125,7 +129,7 @@ FUZZ_TARGET(connman, .init = initialize_connman) (void)connman.GetAddedNodeInfo(fuzzed_data_provider.ConsumeBool()); (void)connman.GetExtraFullOutboundCount(); (void)connman.GetLocalServices(); - (void)connman.GetMaxOutboundTarget(); + assert(connman.GetMaxOutboundTarget() == max_outbound_limit); (void)connman.GetMaxOutboundTimeframe(); (void)connman.GetMaxOutboundTimeLeftInCycle(); (void)connman.GetNetworkActive();