ZeroErr
Loading...
Searching...
No Matches
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 "zeroerr/internal/fuzz_signal.h"
#include <functional>
#include "zeroerr/string.h"
#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
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

namespace  zeroerr
namespace  zeroerr::detail

Macros

#define ZEROERR_CREATE_FUZZ_TEST_FUNC(function, name, ...)
#define FUZZ_TEST_CASE(...)
#define FUZZ_FUNC(func)

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 (zeroerr::String dir)

Macro Definition Documentation

◆ FUZZ_FUNC

#define FUZZ_FUNC ( func)
Value:
zeroerr::FuzzFunction(func, _ZEROERR_TEST_CONTEXT)
FuzzTest< T > FuzzFunction(T func, TestContext *context)
Definition fuzztest.h:223

◆ FUZZ_TEST_CASE

#define FUZZ_TEST_CASE ( ...)
Value:
ZEROERR_CREATE_FUZZ_TEST_FUNC(ZEROERR_NAMEGEN(_zeroerr_testcase), __VA_ARGS__)
#define ZEROERR_NAMEGEN(x)
Definition config.h:110
#define ZEROERR_CREATE_FUZZ_TEST_FUNC(function, name,...)
Definition fuzztest.h:23

◆ ZEROERR_CREATE_FUZZ_TEST_FUNC

#define ZEROERR_CREATE_FUZZ_TEST_FUNC ( function,
name,
... )
Value:
ZEROERR_SUPPRESS_COMMON_WARNINGS_PUSH \
static void function(zeroerr::TestContext*); \
static zeroerr::detail::regTest ZEROERR_NAMEGEN(_zeroerr_reg)( \
{name, __FILE__, __LINE__, function, {__VA_ARGS__}}, zeroerr::TestType::fuzz_test); \
ZEROERR_SUPPRESS_COMMON_WARNINGS_POP \
static void function(ZEROERR_UNUSED(zeroerr::TestContext* _ZEROERR_TEST_CONTEXT))
TestContext is a class that holds the test results and reporter context. There are 8 different matric...
Definition unittest.h:89
#define ZEROERR_UNUSED(x)
Definition config.h:360
@ fuzz_test
Definition unittest.h:297
regTest is a class that is used to register the test case. It will be used as global variables and th...
Definition unittest.h:305