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(CPageAlloc); // in testhookmangen.cpp
50 DECL_TEST(HookManGen);
52 int main(int argc, char *argv[])
56 g_Verbose = argc > 1 && strcmp(argv[1], "-v") == 0;
58 int passed = 0, failed = 0;
62 DO_TEST(VafmtAndOverload);
76 cout << endl << "----" << endl << "Passed: " << passed << endl << "Failed: " << failed << endl;
77 cout << "Total: " << passed + failed << endl;
79 cout << "Press enter to continue" << endl;
85 SourceHook::ISourceHook *Test_Factory()
87 return new SourceHook::Impl::CSourceHookImpl();
90 void Test_Delete(SourceHook::ISourceHook *shptr)
92 delete static_cast<SourceHook::Impl::CSourceHookImpl *>(shptr);
95 void Test_CompleteShutdown(SourceHook::ISourceHook *shptr)
97 static_cast<SourceHook::Impl::CSourceHookImpl *>(shptr)->CompleteShutdown();
100 void Test_UnloadPlugin(SourceHook::ISourceHook *shptr, SourceHook::Plugin plug)
102 static_cast<SourceHook::Impl::CSourceHookImpl *>(shptr)->UnloadPlugin(plug);
105 void Test_PausePlugin(SourceHook::ISourceHook *shptr, SourceHook::Plugin plug)
107 static_cast<SourceHook::Impl::CSourceHookImpl *>(shptr)->PausePlugin(plug);
110 void Test_UnpausePlugin(SourceHook::ISourceHook *shptr, SourceHook::Plugin plug)
112 static_cast<SourceHook::Impl::CSourceHookImpl *>(shptr)->UnpausePlugin(plug);