ZeroErr
zeroerr::CombinationalTest Class Reference

CombinationalTest is a class that is used to cross test a few lists of arguments. One example. More...

#include <unittest.h>

Public Member Functions

 CombinationalTest (std::function< void()> func)
 
template<typename T >
void operator() (T &arg)
 
template<typename T , typename... Args>
void operator() (T &arg, Args &... args)
 

Public Attributes

std::function< void()> func
 

Detailed Description

CombinationalTest is a class that is used to cross test a few lists of arguments. One example.

TestArgs<int> a{1, 2, 3};
TestArgs<int> b{4, 5, 6};
CHECK(targetFunc(a, b) == (a+b));
});
test(a, b);
#define CHECK(...)
Definition: assert.h:151
CombinationalTest(std::function< void()> func)
Definition: unittest.h:293

This will test the targetFunc with all the combinations of a and b, e.g. (1,4), (1,5), (1,6), (2,4), (2,5) ... etc.

Constructor & Destructor Documentation

◆ CombinationalTest()

zeroerr::CombinationalTest::CombinationalTest ( std::function< void()>  func)
inline

Member Function Documentation

◆ operator()() [1/2]

template<typename T >
void zeroerr::CombinationalTest::operator() ( T &  arg)
inline

◆ operator()() [2/2]

template<typename T , typename... Args>
void zeroerr::CombinationalTest::operator() ( T &  arg,
Args &...  args 
)
inline

Member Data Documentation

◆ func

std::function<void()> zeroerr::CombinationalTest::func

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