2 // hello pm how are you
9 #include "sourcehook_impl.h"
17 typedef bool (*TestProto)(std::string&);
21 static std::list<Test *> ms_Tests;
23 Test(TestProto func, const char *name) : m_Func(func), m_Name(name)
25 ms_Tests.push_back(this);
33 cout << "Test" << m_Name << " FAILED: " << error << endl;
38 cout << "Test" << m_Name << " passed" << endl;
45 int passed=0, failed=0;
46 for (std::list<Test*>::iterator iter = ms_Tests.begin(); iter != ms_Tests.end(); ++iter)
53 cout << endl << "----" << endl << "Passed: " << passed << endl << "Failed: " << failed << endl;
54 cout << "Total: " << passed + failed << endl;
58 std::list<Test *> Test::ms_Tests;
61 bool Test##x(std::string &error); \
62 Test g_Test##x(Test##x, #x);
65 DO_TEST(VafmtAndOverload);
70 int main(int argc, char *argv[])
73 int passed=0, failed=0;
75 g_Verbose = argc > 1 && strcmp(argv[1], "-v") == 0;
79 cout << "Press enter to continue" << endl;