Added manual hooks. I hope that I haven't broken binary compatibility - someone might want to test it.
2 // hello pm how are you
3 // I'm fine, what about you?
4 // not bad, just looking for mem leaks
12 #include "sh_tinyhash.h"
14 #include "sourcehook_impl.h"
15 #include "sourcehook.h"
23 typedef bool (*TestProto)(std::string&);
27 static SourceHook::List<Test *> ms_Tests;
29 Test(TestProto func, const char *name) : m_Func(func), m_Name(name)
31 ms_Tests.push_back(this);
39 cout << "Test" << m_Name << " FAILED: " << error << endl;
44 cout << "Test" << m_Name << " passed" << endl;
51 int passed=0, failed=0;
52 for (SourceHook::List<Test*>::iterator iter = ms_Tests.begin(); iter != ms_Tests.end(); ++iter)
59 cout << endl << "----" << endl << "Passed: " << passed << endl << "Failed: " << failed << endl;
60 cout << "Total: " << passed + failed << endl;
64 SourceHook::List<Test *> Test::ms_Tests;
67 bool Test##x(std::string &error); \
68 Test g_Test##x(Test##x, #x);
72 DO_TEST(VafmtAndOverload);
79 int main(int argc, char *argv[])
83 g_Verbose = argc > 1 && strcmp(argv[1], "-v") == 0;
87 cout << "Press enter to continue" << endl;