diff -r a88d5ff76c28 -r 8d8efeb2ecc8 sourcehook/test/testbail.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sourcehook/test/testbail.cpp Fri May 27 21:39:30 2005 +0000 @@ -0,0 +1,37 @@ +// TESTBAIL +// Test for a bug Bail has found + +#include "testbail.h" + +void *___testbail_gabgab; + +bool TestBail(std::string &error) +{ + SourceHook::CSourceHookImpl g_SHImpl; + g_SHPtr = &g_SHImpl; + g_PLID = 1; + + g_Gabgab = new IGaben; + ___testbail_gabgab = (void*)g_Gabgab; + + g_Gabgab->EatYams(); + + SH_ADD_HOOK_STATICFUNC(IGaben, EatYams, g_Gabgab, EatYams0_Handler, false); + + g_Gabgab->EatYams(); + + ___TestBail2(); + + g_Gabgab->EatYams(); + + SH_REMOVE_HOOK_STATICFUNC(IGaben, EatYams, g_Gabgab, EatYams0_Handler, false); + + g_Gabgab->EatYams(); + + delete g_Gabgab; + + // If it didn't crash, it's ok + + return true; +} +