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 20:09:06 -0700 |
commit | 1aecc70750ee6ce9c96ebf3e6b4a7fb322ff8ca3 (patch) | |
tree | 1e2c607ae9980b47917effe4203b4448a1dd4c5f /libmisc/tests/test_rand.c | |
parent | c7a0d6de46610ac9ceaea5afe1b7983550fc1be6 (diff) |
Build the full matrix of CMAKE_BUILD_TYPE
Diffstat (limited to 'libmisc/tests/test_rand.c')
-rw-r--r-- | libmisc/tests/test_rand.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libmisc/tests/test_rand.c b/libmisc/tests/test_rand.c index 282c6a4..8076155 100644 --- a/libmisc/tests/test_rand.c +++ b/libmisc/tests/test_rand.c @@ -14,6 +14,7 @@ /* Intercept failures *********************************************************/ +#ifndef NDEBUG jmp_buf *__catch; void __lm_abort(void) { @@ -34,6 +35,7 @@ void __lm_abort(void) { __catch = old_catch; \ } \ } while (0); +#endif /* Actual tests ***************************************************************/ @@ -42,7 +44,11 @@ void __lm_abort(void) { static void test_n(uint64_t cnt) { if (cnt == 0 || cnt > UINT64_C(1)<<63) { +#ifndef NDEBUG should_abort(rand_uint63n(cnt)); +#else + return; +#endif } else { double sum = 0; bool seen[MAX_SEE_ALL] = {0}; |