Added the failed expression in the message
This commit is contained in:
parent
2bf960df27
commit
969e1d0915
1 changed files with 12 additions and 8 deletions
|
|
@ -33,10 +33,12 @@
|
|||
debugBreak(); \
|
||||
} while (0)
|
||||
|
||||
#define ASSERT(expression) \
|
||||
do { \
|
||||
if (!(expression)) \
|
||||
ASSERTFALSE; \
|
||||
#define ASSERT(expression) \
|
||||
do { \
|
||||
if (!(expression)) { \
|
||||
std::cerr << "Assert failed: " << #expression << '\n'; \
|
||||
ASSERTFALSE; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define CHECKFALSE \
|
||||
|
|
@ -44,10 +46,12 @@
|
|||
std::cerr << "Check failed at " << __FILE__ << ":" << __LINE__ << '\n'; \
|
||||
} while (0)
|
||||
|
||||
#define CHECK(expression) \
|
||||
do { \
|
||||
if (!(expression)) \
|
||||
CHECKFALSE; \
|
||||
#define CHECK(expression) \
|
||||
do { \
|
||||
if (!(expression)) { \
|
||||
std::cerr << "Check failed: " << #expression << '\n'; \
|
||||
CHECKFALSE; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#else // NDEBUG
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue