summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-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;