/* * test.h * * Created on: 24.10.2012 * Author: trifon */ #ifndef TEST_H_ #define TEST_H_ #include using namespace std; const int MAX_TEST_DESCRIPTION = 100; typedef bool (*TestFunction)(); struct Test { char description[MAX_TEST_DESCRIPTION]; TestFunction test; }; void runTests(Test tests[], int ntests) { for(int i = 0; i < ntests; i++) { cerr << tests[i].description << ":"; bool result = tests[i].test(); if (result) cerr << "OK\n"; else cerr << "FAILED!\n"; } } #endif /* TEST_H_ */