mirror of
https://git.recroomarchive.org/Radium/libradhook.git
synced 2026-08-07 09:10:59 +00:00
initial commit
This commit is contained in:
19
tests/test_failure_cases.cpp
Normal file
19
tests/test_failure_cases.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user