1.1 --- a/sourcehook/test/testbail2.cpp Fri Dec 23 11:58:11 2005 +0000
1.2 +++ b/sourcehook/test/testbail2.cpp Fri Dec 23 23:00:55 2005 +0000
1.3 @@ -5,21 +5,33 @@
1.4 #include "sourcehook_test.h"
1.5 #include "testbail.h"
1.6
1.7 -// :TODO: Test new-old proto system compa
1.8
1.9 -bool ___TestBail2(std::string &error)
1.10 +int EatYams_Handler2(int a)
1.11 {
1.12 - g_SHPtr = ___testbail_shptr;
1.13 - g_PLID = 2;
1.14 + ADD_STATE(State_EatYams_Handler2_Called(a));
1.15 + RETURN_META_VALUE_NEWPARAMS(MRES_OVERRIDE, 6, &IGaben::EatYams, (0xBEEF));
1.16 +}
1.17
1.18 - g_Gabgab = (IGaben*)___testbail_gabgab;
1.19 +int EatYams_Handler3(int a)
1.20 +{
1.21 + ADD_STATE(State_EatYams_Handler3_Called(a));
1.22 + RETURN_META_VALUE(MRES_IGNORED, 0);
1.23 +}
1.24
1.25 - SH_ADD_HOOK_STATICFUNC(IGaben, EatYams, g_Gabgab, ___testbail_EatYams_Handler2, false);
1.26 - SH_ADD_HOOK_STATICFUNC(IGaben, EatYams, g_Gabgab, ___testbail_EatYams_Handler3, false);
1.27 +namespace N_TestBail
1.28 +{
1.29 + bool TestBail2(std::string &error)
1.30 + {
1.31 + g_PLID = 2;
1.32 +
1.33 + SH_ADD_HOOK_STATICFUNC(IGaben, EatYams, g_Gabgab, EatYams_Handler2, false);
1.34 + SH_ADD_HOOK_STATICFUNC(IGaben, EatYams, g_Gabgab, EatYams_Handler3, false);
1.35
1.36 - int ret = g_Gabgab->EatYams(0xDEAD);
1.37 -
1.38 - CHECK_COND(ret == 6, "Part 2.1");
1.39 -
1.40 - return true;
1.41 + int ret = g_Gabgab->EatYams(0xDEAD);
1.42 +
1.43 + CHECK_COND(ret == 6, "Part 2.1");
1.44 +
1.45 + return true;
1.46 + }
1.47 }
1.48 +