Files
libradhook/tests/test_failure_cases.cpp
nexusverypro 3192afe07d initial commit
2026-07-03 02:00:27 +01:00

19 lines
418 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
auto r1 = RadHookCreate((void*)fn, nullptr, &h);
assert(r1 != RadHookResult::Success);
// invalid target
auto r2 = RadHookCreate(nullptr, (void*)detour, &h);
assert(r2 != RadHookResult::Success);
return 0;
}