sourcehook/test/testbail2.cpp
author Scott Ehlert <ds@alliedmods.net>
Sun Aug 13 11:34:30 2006 +0000 (2006-08-13)
changeset 238 c27105949293
parent 163 377bdd31c28d
child 294 0d87bc8606f8
permissions -rw-r--r--
Wow, lots of stuff here
1) Bumped version to 1.3
2) Fixed MSVC project files to compile and link against latest SDK
3) Fixed Linux compilation of stub_mm and sample_mm against new SDK (added -msse to makefiles)
4) Removed -fpermissive and -Wno-deprecated from Linux makefiles
5) Added -Wall -Wno-non-virtual-dtor -Werror to Linux makefiles
6) Stub_mm and sample_mm no longer dynamically link to libstdc++
7) SourceMM, stub_mm, and sample_mm compile cleanly (no warnings) with GCC 3.4.x and 4.x
     1 // TESTBAIL
     2 //  Different compilation unit
     3 
     4 #include "sourcehook.h"
     5 #include "sourcehook_test.h"
     6 #include "testbail.h"
     7 
     8 
     9 int EatYams_Handler2(int a)
    10 {
    11 	ADD_STATE(State_EatYams_Handler2_Called(a));
    12 	RETURN_META_VALUE_NEWPARAMS(MRES_OVERRIDE, 6, &IGaben::EatYams, (0xBEEF));
    13 }
    14 
    15 int EatYams_Handler3(int a)
    16 {
    17 	ADD_STATE(State_EatYams_Handler3_Called(a));
    18 	RETURN_META_VALUE(MRES_IGNORED, 0);
    19 }
    20 
    21 namespace N_TestBail
    22 {
    23 	bool TestBail2(std::string &error)
    24 	{
    25 		g_PLID = 2;
    26 
    27 		SH_ADD_HOOK_STATICFUNC(IGaben, EatYams, g_Gabgab, EatYams_Handler2, false);
    28 		SH_ADD_HOOK_STATICFUNC(IGaben, EatYams, g_Gabgab, EatYams_Handler3, false);
    29 
    30 		int ret = g_Gabgab->EatYams(0xDEAD);
    31 
    32 		CHECK_COND(ret == 6, "Part 2.1");
    33 
    34 		return true;
    35 	}
    36 }
    37