ZeroErr
fuzztest.h File Reference
#include "zeroerr/internal/config.h"
#include "zeroerr/unittest.h"
#include "zeroerr/domains/aggregate_of.h"
#include "zeroerr/domains/arbitrary.h"
#include "zeroerr/domains/container_of.h"
#include "zeroerr/domains/element_of.h"
#include "zeroerr/domains/in_range.h"
#include "zeroerr/internal/rng.h"
#include <exception>
#include <functional>
#include <string>
#include <tuple>
#include <type_traits>
#include <vector>
Include dependency graph for fuzztest.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  zeroerr::detail::FunctionDecomposition< Args >
 FunctionDecomposition is a meta function to decompose the function type. The ValueType and numOfArgs will be the result of the decomposition. More...
 
struct  zeroerr::detail::memfun_type< T >
 
struct  zeroerr::detail::memfun_type< Ret(Class::*)(Args...) const >
 
struct  zeroerr::IFuzzTest
 
class  zeroerr::FuzzFinishedException
 
struct  zeroerr::FuzzTest< TargetFunction, FuncType >
 FuzzTest is a template class to create a fuzz test for the target function. More...
 
struct  zeroerr::FuzzTestWithDomain< TargetFunction, FuncType, Domain, Base >
 FuzzTestWithDomain implements the Base class with the domain passed into. More...
 

Namespaces

 zeroerr
 
 zeroerr::detail
 

Macros

#define ZEROERR_CREATE_FUZZ_TEST_FUNC(function, name)
 
#define FUZZ_TEST_CASE(name)   ZEROERR_CREATE_FUZZ_TEST_FUNC(ZEROERR_NAMEGEN(_zeroerr_testcase), name)
 
#define FUZZ_FUNC(func)   zeroerr::FuzzFunction(func, _ZEROERR_TEST_CONTEXT)
 

Typedefs

template<typename T >
using zeroerr::detail::FunctionDecompositionT = decltype(FunctionDecompositionImpl(std::declval< T >()))
 

Functions

template<typename... Args>
FunctionDecomposition< typename std::decay< Args >::type... > zeroerr::detail::FunctionDecompositionImpl (void(*)(Args...))
 
template<typename... Args>
FunctionDecomposition< typename std::decay< Args >::type... > zeroerr::detail::FunctionDecompositionImpl (std::function< void(Args...)>)
 
template<typename F >
memfun_type< decltype(&F::operator())>::ret_type zeroerr::detail::FunctionDecompositionImpl (F)
 
void zeroerr::RunFuzzTest (IFuzzTest &fuzz_test, int seed, int runs, int max_len, int timeout, int len_control)
 
template<typename T >
FuzzTest< T > zeroerr::FuzzFunction (T func, TestContext *context)
 
template<typename T >
std::vector< T > zeroerr::ReadCorpusFromDir (std::string dir)
 

Macro Definition Documentation

◆ FUZZ_FUNC

#define FUZZ_FUNC (   func)    zeroerr::FuzzFunction(func, _ZEROERR_TEST_CONTEXT)

◆ FUZZ_TEST_CASE

#define FUZZ_TEST_CASE (   name)    ZEROERR_CREATE_FUZZ_TEST_FUNC(ZEROERR_NAMEGEN(_zeroerr_testcase), name)

◆ ZEROERR_CREATE_FUZZ_TEST_FUNC

#define ZEROERR_CREATE_FUZZ_TEST_FUNC (   function,
  name 
)
Value:
static void function(zeroerr::TestContext*); \
static zeroerr::detail::regTest ZEROERR_NAMEGEN(_zeroerr_reg)( \
{name, __FILE__, __LINE__, function}, zeroerr::TestType::fuzz_test); \
TestContext is a class that holds the test results and reporter context. There are 8 different matric...
Definition: unittest.h:67
#define ZEROERR_NAMEGEN(x)
Definition: config.h:104
#define ZEROERR_UNUSED(x)
Definition: config.h:324
constexpr bool _ZEROERR_TEST_CONTEXT
Definition: assert.h:209
@ fuzz_test
Definition: unittest.h:254
regTest is a class that is used to register the test case. It will be used as global variables and th...
Definition: unittest.h:262