debug: add CHECK_SANITY macro

This commit is contained in:
Danny Robson 2016-06-24 15:30:41 +10:00
parent 791b65a8bb
commit 9b4ce6555e

View File

@ -72,6 +72,18 @@
); \
} while (0)
///////////////////////////////////////////////////////////////////////////////
#define CHECK_SANITY(A) do { \
DEBUG_ONLY( \
const auto &__a = (A); \
if (!util::debug::valid (__a)) { \
_CHECK_PANIC("failed sanity test for %s, %!\n", #A, __a); \
} \
); \
} while (0)
///////////////////////////////////////////////////////////////////////////////
#define CHECK_EQ(A,B) do { \
DEBUG_ONLY( \