Debug assert should fire on failure, not success!

This commit is contained in:
Devin J. Pohly
2014-02-23 00:23:23 -05:00
parent cb07827c21
commit 1e04f576d2
+2 -2
View File
@@ -145,8 +145,8 @@ void ShowWarningOrTrace( const char *file, int line, const char *message, bool b
#ifdef DEBUG #ifdef DEBUG
// No reason to kill the program. A lot of these don't produce a crash in NDEBUG so why stop? // No reason to kill the program. A lot of these don't produce a crash in NDEBUG so why stop?
// TODO: These should have something you can hook a breakpoint on. // TODO: These should have something you can hook a breakpoint on.
#define DEBUG_ASSERT(x) if(unlikely(x)) WARN("Debug assert failed") #define DEBUG_ASSERT_M(COND,MESSAGE) if(unlikely(!(COND))) WARN(MESSAGE)
#define DEBUG_ASSERT_M(x,y) if(unlikely(x)) WARN(y) #define DEBUG_ASSERT(COND) DEBUG_ASSERT_M(COND,"Debug assert failed")
#else #else
/** @brief A dummy define to keep things going smoothly. */ /** @brief A dummy define to keep things going smoothly. */
#define DEBUG_ASSERT(x) #define DEBUG_ASSERT(x)