sh_stack now works if assert is disabled (stupid me), simple reentrancy test, META_IFACEPTR takes a type argument
2 // hello pm how are you
3 // I'm fine, what about you?
11 #include "sh_tinyhash.h"
13 #include "sourcehook_impl.h"
21 typedef bool (*TestProto)(std::string&);
25 static SourceHook::List<Test *> ms_Tests;
27 Test(TestProto func, const char *name) : m_Func(func), m_Name(name)
29 ms_Tests.push_back(this);
37 cout << "Test" << m_Name << " FAILED: " << error << endl;
42 cout << "Test" << m_Name << " passed" << endl;
49 int passed=0, failed=0;
50 for (SourceHook::List<Test*>::iterator iter = ms_Tests.begin(); iter != ms_Tests.end(); ++iter)
57 cout << endl << "----" << endl << "Passed: " << passed << endl << "Failed: " << failed << endl;
58 cout << "Total: " << passed + failed << endl;
62 SourceHook::List<Test *> Test::ms_Tests;
65 bool Test##x(std::string &error); \
66 Test g_Test##x(Test##x, #x);
70 DO_TEST(VafmtAndOverload);
76 int main(int argc, char *argv[])
80 g_Verbose = argc > 1 && strcmp(argv[1], "-v") == 0;
84 cout << "Press enter to continue" << endl;