From ff1252fe3db1ba639fe148f45b0408a4f182da0d Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Mon, 14 Aug 2017 07:43:07 +0000 Subject: Tests and fixes https://github.com/genetics-statistics/GEMMA/issues/26 --- src/debug.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/debug.h') diff --git a/src/debug.h b/src/debug.h index fafebcf..3fbe9e0 100644 --- a/src/debug.h +++ b/src/debug.h @@ -7,10 +7,15 @@ // enforce works like assert but also when NDEBUG is set (i.e., it // always works). enforce_msg prints message instead of expr +#define ROUND(f) round(f * 10000.)/10000 #if defined NDEBUG #define debug_msg(msg) +#define assert_issue(is_issue, expr) #else #define debug_msg(msg) cout << "**** DEBUG: " << msg << endl; +#define assert_issue(is_issue, expr) \ + ((is_issue) ? enforce_msg(expr,"FAIL: ISSUE assert") : __ASSERT_VOID_CAST(0)) + #endif /* This prints an "Assertion failed" message and aborts. */ @@ -49,4 +54,5 @@ inline void __enforce_fail(const char *__assertion, const char *__file, : __enforce_fail(gsl_strerror(COMBINE(res, __LINE__)), __FILE__, \ __LINE__, __ASSERT_FUNCTION)) + #endif -- cgit v1.2.3