11 #define TEST(a) std::cout << "TEST: " << (a)<<std::endl
12 #define TESTMSG(a,b) std::cout << "TEST: " << a<<b<<std::endl
13 #define TESTVALUE(a) std::cout << "TEST: " << #a << ": " << a<<std::endl
26 std::string separation()
const{
27 return "+++++++++++++++++++++++++++++++++++++++++++++++++\n";
30 std::string print_between_plus(std::string& s)
const{
31 std::stringstream res;
32 res <<
"+++++++++++++++++"<<s<<
"+++++++++++++++++\n";
38 Test(std::string name_,
bool (*test_)()){
44 std::cout << print_between_plus(name);
47 std::string getName(){
56 std::list<Test> tests;
59 void add(std::string name_,
bool (*test_)()){
60 Test test(name_,test_);
61 tests.push_back(test);
64 bool tests_succesful(
true);
65 std::vector<bool> res;
66 for (
Test test : tests){
67 res.push_back(test.run());
69 std::cout <<
"\n\n results of tests : "<<std::endl;
72 std::cout <<
"Test "<<i<<
" \""<<t.getName()<<
"\" --> ";
73 if (res[i++]) std::cout <<
"OK"<<std::endl;
75 std::cout <<
"Fail"<<std::endl;
76 tests_succesful =
false;
80 return tests_succesful;