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
|
|
@ -35,8 +35,10 @@
|
||||||
|
|
||||||
#define ASSERT(expression) \
|
#define ASSERT(expression) \
|
||||||
do { \
|
do { \
|
||||||
if (!(expression)) \
|
if (!(expression)) { \
|
||||||
|
std::cerr << "Assert failed: " << #expression << '\n'; \
|
||||||
ASSERTFALSE; \
|
ASSERTFALSE; \
|
||||||
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define CHECKFALSE \
|
#define CHECKFALSE \
|
||||||
|
|
@ -46,8 +48,10 @@
|
||||||
|
|
||||||
#define CHECK(expression) \
|
#define CHECK(expression) \
|
||||||
do { \
|
do { \
|
||||||
if (!(expression)) \
|
if (!(expression)) { \
|
||||||
|
std::cerr << "Check failed: " << #expression << '\n'; \
|
||||||
CHECKFALSE; \
|
CHECKFALSE; \
|
||||||
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#else // NDEBUG
|
#else // NDEBUG
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue