sourcehook/test/testbail.h
author Pavol Marko <pavolmarko@gmail.com>
Fri Dec 23 11:58:11 2005 +0000 (2005-12-23)
changeset 162 a95db73792e5
parent 117 e322da4af2d2
child 163 377bdd31c28d
permissions -rw-r--r--
One bugfix, addition of META_RETURN_(VALUE_)NEWPARAMS (implemented using recalls), tests now support compiling against an older version of sourcehook.h (through the sourcehook_test.h file) while main.cpp which now also acts as a CSourceHookImpl factory compiles against the new version.
     1 //////////////////////////////////////////////////////////////////////////
     2 // Shared data for testbail
     3 
     4 #include <string>
     5 #include "testevents.h"
     6 
     7 bool ___TestBail2(std::string &error);
     8 
     9 namespace
    10 {
    11 	StateList g_States;
    12 	SourceHook::ISourceHook *g_SHPtr;
    13 	SourceHook::Plugin g_PLID;
    14 
    15 	MAKE_STATE_1(State_EatYams_Called, int);
    16 	MAKE_STATE_1(State_EatYams_Handler1_Called, int);
    17 	MAKE_STATE_1(State_EatYams_Handler2_Called, int);
    18 	MAKE_STATE_1(State_EatYams_Handler3_Called, int);
    19 	MAKE_STATE_1(State_EatYams_Return, int);
    20 
    21 	class IGaben
    22 	{
    23 	public:
    24 		virtual int EatYams(int a)
    25 		{
    26 			ADD_STATE(State_EatYams_Called(a));
    27 			return 5;
    28 		}
    29 	};
    30 
    31 	SH_DECL_HOOK1(IGaben, EatYams, SH_NOATTRIB, 0, int, int);
    32 
    33 	IGaben *g_Gabgab;
    34 }
    35 
    36 extern void *___testbail_gabgab;
    37 extern SourceHook::ISourceHook *___testbail_shptr;
    38 extern int ___testbail_EatYams_Handler2(int a);
    39 extern int ___testbail_EatYams_Handler3(int a);