Software APIs
Public Member Functions | Protected Attributes
bootstrap_fuzzer::AbstractBootstrapMockGroup Class Reference

This class configures mock objects with reasonable defaults. More...

#include <sw/device/silicon_creator/lib/bootstrap_fuzzer_util.h>

Public Member Functions

 AbstractBootstrapMockGroup (StreamParser stream, bool verbose)
 
 AbstractBootstrapMockGroup (AbstractBootstrapMockGroup &)=delete
 
 AbstractBootstrapMockGroup (AbstractBootstrapMockGroup &&)=delete
 
virtual void ConfigureMocks ()
 This method configures the mocks owned by AbstractBootstrapMockGroup. More...
 

Protected Attributes

bool verbose_ {false}
 
bool flash_status_override_ {false}
 
size_t max_spi_cmd_count_ {0}
 
size_t spi_cmd_count_ {0}
 
StreamParser stream_
 
::rom_test::NiceMockSpiDevice spi_device_
 
::rom_test::NiceMockRstmgr rstmgr_
 
::rom_test::NiceMockFlashCtrl flash_ctrl_
 
::rom_test::NiceMockOtp otp_
 

Detailed Description

This class configures mock objects with reasonable defaults.

Some mocks will enable the fuzzing engine to drive control flow by getting values from a StreamParser. Instantiate this class once per call to LLVMFuzzerTestOneInput().

Definition at line 124 of file bootstrap_fuzzer_util.h.

Constructor & Destructor Documentation

◆ AbstractBootstrapMockGroup()

bootstrap_fuzzer::AbstractBootstrapMockGroup::AbstractBootstrapMockGroup ( StreamParser  stream,
bool  verbose 
)
Parameters
dataA chunk of data generated by the fuzzing engine.
verboseWhether to enable verbose logging.

Definition at line 38 of file bootstrap_fuzzer_util.cc.

Member Function Documentation

◆ ConfigureMocks()

void bootstrap_fuzzer::AbstractBootstrapMockGroup::ConfigureMocks ( )
virtual

This method configures the mocks owned by AbstractBootstrapMockGroup.

If you add custom mocks in a derived class and override this method, be sure to call AbstractBootstrapMockGroup::ConfigureMocks().

Reimplemented in anonymous_namespace{bootstrap_fuzz_test.cc}::RomMockGroup.

Definition at line 42 of file bootstrap_fuzzer_util.cc.