summaryrefslogtreecommitdiffhomepage
path: root/test/hook.test.c
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2022-06-27 00:36:48 +0100
committerMichael Smith <mikesmiffy128@gmail.com>2022-06-27 00:36:48 +0100
commite3fd5ad05a7d933d401de431ce2d27a99d3b9995 (patch)
tree09e302cd63672f2ae1c7bf80a1d5ce164cfcd857 /test/hook.test.c
parent37afe67488ed93dc5e39942271dd24481797fe77 (diff)
Add update detection, clean up minor stuff
Diffstat (limited to 'test/hook.test.c')
-rw-r--r--test/hook.test.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/hook.test.c b/test/hook.test.c
index b2e841c..7cbfd15 100644
--- a/test/hook.test.c
+++ b/test/hook.test.c
@@ -33,12 +33,14 @@ static int other_hook(int a, int b) {
}
TEST("Inline hooks should be able to wrap the original function") {
+ if (!hook_init()) return false;
orig_some_function = hook_inline(&some_function, &some_hook);
if (!orig_some_function) return false;
return some_function(5, 5) == 15;
}
TEST("Inline hooks should be removable again") {
+ if (!hook_init()) return false;
orig_some_function = hook_inline(&some_function, &some_hook);
if (!orig_some_function) return false;
unhook_inline(orig_some_function);
@@ -46,6 +48,7 @@ TEST("Inline hooks should be removable again") {
}
TEST("Multiple functions should be able to be inline hooked at once") {
+ if (!hook_init()) return false;
orig_some_function = hook_inline(&some_function, &some_hook);
if (!orig_some_function) return false;