ZeroErr
zeroerr::FuzzTest< TargetFunction, FuncType > Struct Template Reference

FuzzTest is a template class to create a fuzz test for the target function. More...

#include <fuzztest.h>

Inheritance diagram for zeroerr::FuzzTest< TargetFunction, FuncType >:
Collaboration diagram for zeroerr::FuzzTest< TargetFunction, FuncType >:

Public Types

using ValueType = typename FuncType::ValueType
 
template<typename... T>
using FuzzTestWithDomainType = FuzzTestWithDomain< TargetFunction, FuncType, AggregateOf< std::tuple< typename T::ValueType... >, T... > >
 

Public Member Functions

 FuzzTest (TargetFunction func, TestContext *context)
 
 FuzzTest (const FuzzTest &other)
 
template<typename... T>
FuzzTestWithDomainType< T... > WithDomains (AggregateOf< std::tuple< typename T::ValueType... >, T... > domain)
 
template<typename... T>
FuzzTestWithDomainType< T... > WithDomains (T &&... domains)
 
FuzzTestWithSeeds (std::vector< ValueType > _seeds)
 
virtual void Run (int=1000, int=0)
 
virtual void RunOneTime (const uint8_t *, size_t)
 
virtual std::string MutateData (const uint8_t *, size_t, size_t, unsigned int)
 
- Public Member Functions inherited from zeroerr::IFuzzTest
bool should_stop ()
 

Public Attributes

TargetFunction func
 
TestContextcontext
 
std::vector< ValueTypeseeds
 
- Public Attributes inherited from zeroerr::IFuzzTest
int count = 0
 
int max_count = 0
 

Detailed Description

template<typename TargetFunction, typename FuncType>
struct zeroerr::FuzzTest< TargetFunction, FuncType >

FuzzTest is a template class to create a fuzz test for the target function.

Template Parameters
TargetFunctionThe target function to fuzz.
FuncTypeis the decomposition result of the target function.

Member Typedef Documentation

◆ FuzzTestWithDomainType

template<typename TargetFunction , typename FuncType >
template<typename... T>
using zeroerr::FuzzTest< TargetFunction, FuncType >::FuzzTestWithDomainType = FuzzTestWithDomain<TargetFunction, FuncType, AggregateOf<std::tuple<typename T::ValueType...>, T...> >

◆ ValueType

template<typename TargetFunction , typename FuncType >
using zeroerr::FuzzTest< TargetFunction, FuncType >::ValueType = typename FuncType::ValueType

Constructor & Destructor Documentation

◆ FuzzTest() [1/2]

template<typename TargetFunction , typename FuncType >
zeroerr::FuzzTest< TargetFunction, FuncType >::FuzzTest ( TargetFunction  func,
TestContext context 
)
inline

◆ FuzzTest() [2/2]

template<typename TargetFunction , typename FuncType >
zeroerr::FuzzTest< TargetFunction, FuncType >::FuzzTest ( const FuzzTest< TargetFunction, FuncType > &  other)
inline

Member Function Documentation

◆ MutateData()

template<typename TargetFunction , typename FuncType >
virtual std::string zeroerr::FuzzTest< TargetFunction, FuncType >::MutateData ( const uint8_t *  ,
size_t  ,
size_t  ,
unsigned int   
)
inlinevirtual

Implements zeroerr::IFuzzTest.

◆ Run()

template<typename TargetFunction , typename FuncType >
virtual void zeroerr::FuzzTest< TargetFunction, FuncType >::Run ( int  = 1000,
int  = 0 
)
inlinevirtual

Implements zeroerr::IFuzzTest.

◆ RunOneTime()

template<typename TargetFunction , typename FuncType >
virtual void zeroerr::FuzzTest< TargetFunction, FuncType >::RunOneTime ( const uint8_t *  ,
size_t   
)
inlinevirtual

Implements zeroerr::IFuzzTest.

◆ WithDomains() [1/2]

template<typename TargetFunction , typename FuncType >
template<typename... T>
FuzzTestWithDomainType<T...> zeroerr::FuzzTest< TargetFunction, FuncType >::WithDomains ( AggregateOf< std::tuple< typename T::ValueType... >, T... >  domain)
inline
Template Parameters
TThe domain type to use.

◆ WithDomains() [2/2]

template<typename TargetFunction , typename FuncType >
template<typename... T>
FuzzTestWithDomainType<T...> zeroerr::FuzzTest< TargetFunction, FuncType >::WithDomains ( T &&...  domains)
inline
Template Parameters
TThe domain type to use. This function will decompose the domain type and use tuple to represent the list of domains. The previous function is matched in this call.

◆ WithSeeds()

template<typename TargetFunction , typename FuncType >
FuzzTest& zeroerr::FuzzTest< TargetFunction, FuncType >::WithSeeds ( std::vector< ValueType _seeds)
inline

Member Data Documentation

◆ context

template<typename TargetFunction , typename FuncType >
TestContext* zeroerr::FuzzTest< TargetFunction, FuncType >::context

◆ func

template<typename TargetFunction , typename FuncType >
TargetFunction zeroerr::FuzzTest< TargetFunction, FuncType >::func

◆ seeds

template<typename TargetFunction , typename FuncType >
std::vector<ValueType> zeroerr::FuzzTest< TargetFunction, FuncType >::seeds

The documentation for this struct was generated from the following file: