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);
50 int main(int argc, char *argv[])
54 g_Verbose = argc > 1 && strcmp(argv[1], "-v") == 0;
56 int passed = 0, failed = 0;
60 DO_TEST(VafmtAndOverload);
72 cout << endl << "----" << endl << "Passed: " << passed << endl << "Failed: " << failed << endl;
73 cout << "Total: " << passed + failed << endl;
75 cout << "Press enter to continue" << endl;
81 SourceHook::ISourceHook *Test_Factory()
83 return new SourceHook::Impl::CSourceHookImpl();
86 void Test_Delete(SourceHook::ISourceHook *shptr)
88 delete static_cast<SourceHook::Impl::CSourceHookImpl *>(shptr);
91 void Test_CompleteShutdown(SourceHook::ISourceHook *shptr)
93 static_cast<SourceHook::Impl::CSourceHookImpl *>(shptr)->CompleteShutdown();
96 void Test_UnloadPlugin(SourceHook::ISourceHook *shptr, SourceHook::Plugin plug)
98 static_cast<SourceHook::Impl::CSourceHookImpl *>(shptr)->UnloadPlugin(plug);
101 void Test_PausePlugin(SourceHook::ISourceHook *shptr, SourceHook::Plugin plug)
103 static_cast<SourceHook::Impl::CSourceHookImpl *>(shptr)->PausePlugin(plug);
106 void Test_UnpausePlugin(SourceHook::ISourceHook *shptr, SourceHook::Plugin plug)
108 static_cast<SourceHook::Impl::CSourceHookImpl *>(shptr)->UnpausePlugin(plug);