summaryrefslogtreecommitdiff
path: root/deps/jemalloc/test/unit/hooks.c
diff options
context:
space:
mode:
Diffstat (limited to 'deps/jemalloc/test/unit/hooks.c')
-rw-r--r--deps/jemalloc/test/unit/hooks.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/deps/jemalloc/test/unit/hooks.c b/deps/jemalloc/test/unit/hooks.c
deleted file mode 100644
index b70172e13..000000000
--- a/deps/jemalloc/test/unit/hooks.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#include "test/jemalloc_test.h"
-
-static bool hook_called = false;
-
-static void
-hook() {
- hook_called = true;
-}
-
-static int
-func_to_hook(int arg1, int arg2) {
- return arg1 + arg2;
-}
-
-#define func_to_hook JEMALLOC_HOOK(func_to_hook, hooks_libc_hook)
-
-TEST_BEGIN(unhooked_call) {
- hooks_libc_hook = NULL;
- hook_called = false;
- assert_d_eq(3, func_to_hook(1, 2), "Hooking changed return value.");
- assert_false(hook_called, "Nulling out hook didn't take.");
-}
-TEST_END
-
-TEST_BEGIN(hooked_call) {
- hooks_libc_hook = &hook;
- hook_called = false;
- assert_d_eq(3, func_to_hook(1, 2), "Hooking changed return value.");
- assert_true(hook_called, "Hook should have executed.");
-}
-TEST_END
-
-int
-main(void) {
- return test(
- unhooked_call,
- hooked_call);
-}