diff options
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}; |