@ -12,21 +12,29 @@
# include <test/fuzz/fuzz.h>
# include <test/fuzz/fuzz.h>
# include <test/fuzz/util.h>
# include <test/fuzz/util.h>
# include <test/util/setup_common.h>
# include <test/util/setup_common.h>
# include <util/system.h>
# include <util/translation.h>
# include <util/translation.h>
# include <cstdint>
# include <cstdint>
# include <vector>
# include <vector>
namespace {
const BasicTestingSetup * g_setup ;
} // namespace
void initialize_connman ( )
void initialize_connman ( )
{
{
static const auto testing_setup = MakeNoLogFileContext < > ( ) ;
static const auto testing_setup = MakeNoLogFileContext < > ( ) ;
g_setup = testing_setup . get ( ) ;
}
}
FUZZ_TARGET_INIT ( connman , initialize_connman )
FUZZ_TARGET_INIT ( connman , initialize_connman )
{
{
FuzzedDataProvider fuzzed_data_provider { buffer . data ( ) , buffer . size ( ) } ;
FuzzedDataProvider fuzzed_data_provider { buffer . data ( ) , buffer . size ( ) } ;
SetMockTime ( ConsumeTime ( fuzzed_data_provider ) ) ;
SetMockTime ( ConsumeTime ( fuzzed_data_provider ) ) ;
AddrMan addrman ( /*asmap=*/ std : : vector < bool > ( ) , /*deterministic=*/ false , /*consistency_check_ratio=*/ 0 ) ;
AddrMan addrman ( /*asmap=*/ std : : vector < bool > ( ) ,
/*deterministic=*/ false ,
g_setup - > m_node . args - > GetIntArg ( " -checkaddrman " , 0 ) ) ;
CConnman connman { fuzzed_data_provider . ConsumeIntegral < uint64_t > ( ) , fuzzed_data_provider . ConsumeIntegral < uint64_t > ( ) , addrman , fuzzed_data_provider . ConsumeBool ( ) } ;
CConnman connman { fuzzed_data_provider . ConsumeIntegral < uint64_t > ( ) , fuzzed_data_provider . ConsumeIntegral < uint64_t > ( ) , addrman , fuzzed_data_provider . ConsumeBool ( ) } ;
CNetAddr random_netaddr ;
CNetAddr random_netaddr ;
CNode random_node = ConsumeNode ( fuzzed_data_provider ) ;
CNode random_node = ConsumeNode ( fuzzed_data_provider ) ;