ZeroErr
载入中...
搜索中...
未找到
zeroerr::CombinationalTest类 参考

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

#include <unittest.h>

Public 成员函数

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

Public 属性

std::function< void()> func
 

详细描述

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};
CombinationalTest test([&]{
CHECK(targetFunc(a, b) == (a+b));
});
test(a, b);
#define CHECK(...)
Definition assert.h:161
TestArgs is a class that is used to store the test arguments.
Definition unittest.h:331

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.

构造及析构函数说明

◆ CombinationalTest()

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

成员函数说明

◆ 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

类成员变量说明

◆ func

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

该类的文档由以下文件生成: