rewritten sh's template files to use new shworker syntax, fixed sh_call. tbh, i'm good
2 // hello pm how are you
3 // I'm fine, what about you?
4 // not bad, just looking for mem leaks
5 // mem leaks in my code!? never! I have to preserve binary compatibility :(
13 #include "sh_tinyhash.h"
15 #include "sourcehook_impl.h"
16 #include "sourcehook.h"
24 typedef bool (*TestProto)(std::string&);
28 static SourceHook::List<Test *> ms_Tests;
30 Test(TestProto func, const char *name) : m_Func(func), m_Name(name)
32 ms_Tests.push_back(this);
40 cout << "Test" << m_Name << " FAILED: " << error << endl;
45 cout << "Test" << m_Name << " passed" << endl;
52 int passed=0, failed=0;
53 for (SourceHook::List<Test*>::iterator iter = ms_Tests.begin(); iter != ms_Tests.end(); ++iter)
60 cout << endl << "----" << endl << "Passed: " << passed << endl << "Failed: " << failed << endl;
61 cout << "Total: " << passed + failed << endl;
65 SourceHook::List<Test *> Test::ms_Tests;
68 bool Test##x(std::string &error); \
69 Test g_Test##x(Test##x, #x);
73 //DO_TEST(VafmtAndOverload);
83 int main(int argc, char *argv[])
87 g_Verbose = argc > 1 && strcmp(argv[1], "-v") == 0;
91 cout << "Press enter to continue" << endl;
97 SourceHook::ISourceHook *Test_Factory()
99 return new SourceHook::CSourceHookImpl();
102 void Test_Delete(SourceHook::ISourceHook *shptr)
104 delete static_cast<SourceHook::CSourceHookImpl *>(shptr);
107 void Test_CompleteShutdown(SourceHook::ISourceHook *shptr)
109 static_cast<SourceHook::CSourceHookImpl *>(shptr)->CompleteShutdown();
112 bool Test_IsPluginInUse(SourceHook::ISourceHook *shptr, SourceHook::Plugin plug)
114 return static_cast<SourceHook::CSourceHookImpl *>(shptr)->IsPluginInUse(plug);
117 void Test_UnloadPlugin(SourceHook::ISourceHook *shptr, SourceHook::Plugin plug)
119 static_cast<SourceHook::CSourceHookImpl *>(shptr)->UnloadPlugin(plug);
122 void Test_PausePlugin(SourceHook::ISourceHook *shptr, SourceHook::Plugin plug)
124 static_cast<SourceHook::CSourceHookImpl *>(shptr)->PausePlugin(plug);
127 void Test_UnpausePlugin(SourceHook::ISourceHook *shptr, SourceHook::Plugin plug)
129 static_cast<SourceHook::CSourceHookImpl *>(shptr)->UnpausePlugin(plug);