15 typedef bool (*TestProto)(std::string&);
19 static std::list<Test *> ms_Tests;
21 Test(TestProto func, const char *name) : m_Func(func), m_Name(name)
23 ms_Tests.push_back(this);
31 cout << "Test" << m_Name << " FAILED: " << error << endl;
36 cout << "Test" << m_Name << " passed" << endl;
43 int passed=0, failed=0;
44 for (std::list<Test*>::iterator iter = ms_Tests.begin(); iter != ms_Tests.end(); ++iter)
51 cout << endl << "----" << endl << "Passed: " << passed << endl << "Failed: " << failed << endl;
52 cout << "Total: " << passed + failed << endl;
56 std::list<Test *> Test::ms_Tests;
59 bool Test##x(std::string &error); \
60 Test g_Test##x(Test##x, #x);
63 DO_TEST(VafmtAndOverload);
68 int main(int argc, char *argv[])
71 int passed=0, failed=0;
73 g_Verbose = argc > 1 && strcmp(argv[1], "-v") == 0;
77 cout << "Press enter to continue" << endl;