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 :(
14 #include "sourcehook_impl.h"
15 #include "sourcehook.h"
20 #define DECL_TEST(x) bool Test##x(std::string &error);
27 cout << "Test" << #x << " passed" << endl; \
32 cout << "Test" << #x << " FAILED: " << error << endl; \
38 DECL_TEST(VafmtAndOverload);
39 DECL_TEST(ThisPtrOffs);
49 DECL_TEST(HookManGen);
51 int main(int argc, char *argv[])
55 g_Verbose = argc > 1 && strcmp(argv[1], "-v") == 0;
57 int passed = 0, failed = 0;
61 DO_TEST(VafmtAndOverload);
74 cout << endl << "----" << endl << "Passed: " << passed << endl << "Failed: " << failed << endl;
75 cout << "Total: " << passed + failed << endl;
77 cout << "Press enter to continue" << endl;
83 SourceHook::ISourceHook *Test_Factory()
85 return new SourceHook::Impl::CSourceHookImpl();
88 void Test_Delete(SourceHook::ISourceHook *shptr)
90 delete static_cast<SourceHook::Impl::CSourceHookImpl *>(shptr);
93 void Test_CompleteShutdown(SourceHook::ISourceHook *shptr)
95 static_cast<SourceHook::Impl::CSourceHookImpl *>(shptr)->CompleteShutdown();
98 void Test_UnloadPlugin(SourceHook::ISourceHook *shptr, SourceHook::Plugin plug)
100 static_cast<SourceHook::Impl::CSourceHookImpl *>(shptr)->UnloadPlugin(plug);
103 void Test_PausePlugin(SourceHook::ISourceHook *shptr, SourceHook::Plugin plug)
105 static_cast<SourceHook::Impl::CSourceHookImpl *>(shptr)->PausePlugin(plug);
108 void Test_UnpausePlugin(SourceHook::ISourceHook *shptr, SourceHook::Plugin plug)
110 static_cast<SourceHook::Impl::CSourceHookImpl *>(shptr)->UnpausePlugin(plug);