mirror of
https://git.recroomarchive.org/Radium/libradhook.git
synced 2026-08-07 09:10:59 +00:00
19 lines
643 B
C++
19 lines
643 B
C++
#include <cassert>
|
|
#include "radhook/radhook.h"
|
|
|
|
static int fn() { return 42; }
|
|
static int detour() { return 1337; }
|
|
|
|
int main() {
|
|
RadHookHandle h = nullptr;
|
|
|
|
// invalid detour
|
|
assert(RadHookCreate((void*)fn, nullptr, &h) != RadHookResult::Success);
|
|
|
|
// invalid target
|
|
assert(RadHookCreate(nullptr, (void*)detour, &h) != RadHookResult::Success);
|
|
|
|
// invalid handle operations
|
|
assert(RadHookEnable(nullptr) == RadHookResult::InvalidHandle || RadHookEnable(nullptr) != RadHookResult::Success);
|
|
assert(RadHookDisable(nullptr) == RadHookResult::InvalidHandle || RadHookDisable(nullptr) != RadHookResult::Success);
|
|
} |