diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-12-17 19:18:21 -0700 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-12-26 18:28:34 -0700 |
commit | 79284b25994d90149f4a9a5286ec739770db94ea (patch) | |
tree | 1e6918d094ac7bf2df1041cdc901bb4fe62391e3 /libmisc/tests/test_rand.c | |
parent | 3756c77e536a293fc735726eac0e5f0c3a8b89da (diff) |
libmisc: Rework how test-intercepts work
Diffstat (limited to 'libmisc/tests/test_rand.c')
-rw-r--r-- | libmisc/tests/test_rand.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/libmisc/tests/test_rand.c b/libmisc/tests/test_rand.c index fff1b27..295ea61 100644 --- a/libmisc/tests/test_rand.c +++ b/libmisc/tests/test_rand.c @@ -8,6 +8,7 @@ #include <setjmp.h> #include <libmisc/rand.h> +#include <libmisc/_intercept.h> #include "test.h" @@ -15,19 +16,9 @@ jmp_buf *__catch; -void __assert_msg_fail(const char *expr, - const char *file, unsigned int line, const char *func, - const char *msg) { - static bool in_fail = false; +void __lm_abort(void) { if (__catch) longjmp(*__catch, 1); - if (!in_fail) { - in_fail = true; - printf("error: %s:%u:%s(): assertion \"%s\" failed%s%s\n", - file, line, func, - expr, - msg ? ": " : "", msg); - } abort(); } |