diff -r a95db73792e5 -r 377bdd31c28d sourcehook/test/testbail2.cpp --- a/sourcehook/test/testbail2.cpp Fri Dec 23 11:58:11 2005 +0000 +++ b/sourcehook/test/testbail2.cpp Fri Dec 23 23:00:55 2005 +0000 @@ -5,21 +5,33 @@ #include "sourcehook_test.h" #include "testbail.h" -// :TODO: Test new-old proto system compa -bool ___TestBail2(std::string &error) +int EatYams_Handler2(int a) { - g_SHPtr = ___testbail_shptr; - g_PLID = 2; + ADD_STATE(State_EatYams_Handler2_Called(a)); + RETURN_META_VALUE_NEWPARAMS(MRES_OVERRIDE, 6, &IGaben::EatYams, (0xBEEF)); +} - g_Gabgab = (IGaben*)___testbail_gabgab; +int EatYams_Handler3(int a) +{ + ADD_STATE(State_EatYams_Handler3_Called(a)); + RETURN_META_VALUE(MRES_IGNORED, 0); +} - SH_ADD_HOOK_STATICFUNC(IGaben, EatYams, g_Gabgab, ___testbail_EatYams_Handler2, false); - SH_ADD_HOOK_STATICFUNC(IGaben, EatYams, g_Gabgab, ___testbail_EatYams_Handler3, false); +namespace N_TestBail +{ + bool TestBail2(std::string &error) + { + g_PLID = 2; + + SH_ADD_HOOK_STATICFUNC(IGaben, EatYams, g_Gabgab, EatYams_Handler2, false); + SH_ADD_HOOK_STATICFUNC(IGaben, EatYams, g_Gabgab, EatYams_Handler3, false); - int ret = g_Gabgab->EatYams(0xDEAD); - - CHECK_COND(ret == 6, "Part 2.1"); - - return true; + int ret = g_Gabgab->EatYams(0xDEAD); + + CHECK_COND(ret == 6, "Part 2.1"); + + return true; + } } +