|
dvander@347
|
1 |
// This file is used for backwards compatibility testing |
|
dvander@347
|
2 |
// It allows us to test binary backwards compatibility by using an older include file HERE: |
|
dvander@347
|
3 |
#include "sourcehook.h" // <-- here |
|
dvander@347
|
4 |
// There. main.cpp which implements all of the following function is always usign sourcehook.h |
|
dvander@347
|
5 |
// and the up-to-date sourcehook_impl.h/sourcehook.cpp. The tests use this file however. |
|
dvander@347
|
6 |
// If the test needs an up-to-date version (like the recall test), it can simply |
|
dvander@347
|
7 |
// #include "sourcehook.h" before including this, thus overriding our decision. |
|
dvander@347
|
8 |
|
|
dvander@347
|
9 |
|
|
dvander@347
|
10 |
SourceHook::ISourceHook *Test_Factory(); |
|
dvander@347
|
11 |
void Test_Delete(SourceHook::ISourceHook *shptr); |
|
dvander@347
|
12 |
|
|
dvander@347
|
13 |
struct CSHPtrAutoDestruction |
|
dvander@347
|
14 |
{ |
|
dvander@347
|
15 |
SourceHook::ISourceHook *m_SHPtr; |
|
dvander@347
|
16 |
CSHPtrAutoDestruction(SourceHook::ISourceHook *shptr) : m_SHPtr(shptr) {} |
|
dvander@347
|
17 |
~CSHPtrAutoDestruction() { Test_Delete(m_SHPtr); } |
|
dvander@347
|
18 |
}; |
|
dvander@347
|
19 |
|
|
dvander@347
|
20 |
#define GET_SHPTR(var) var = Test_Factory(); CSHPtrAutoDestruction ___autodestruction(var); |
|
dvander@347
|
21 |
|
|
dvander@347
|
22 |
// Access to CSourceHookImpl functions |
|
dvander@347
|
23 |
void Test_CompleteShutdown(SourceHook::ISourceHook *shptr); |
|
dvander@347
|
24 |
bool Test_IsPluginInUse(SourceHook::ISourceHook *shptr, SourceHook::Plugin plug); |
|
dvander@347
|
25 |
void Test_UnloadPlugin(SourceHook::ISourceHook *shptr, SourceHook::Plugin plug); |
|
dvander@347
|
26 |
void Test_PausePlugin(SourceHook::ISourceHook *shptr, SourceHook::Plugin plug); |
|
dvander@347
|
27 |
void Test_UnpausePlugin(SourceHook::ISourceHook *shptr, SourceHook::Plugin plug); |