summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libadhocutil/boost-test-extra.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libadhocutil/boost-test-extra.h b/libadhocutil/boost-test-extra.h
index 04db643..b05349c 100644
--- a/libadhocutil/boost-test-extra.h
+++ b/libadhocutil/boost-test-extra.h
@@ -7,4 +7,10 @@
} \
else
+#define BOOST_CHECK_EQUAL_IF(EQ, EXPR) \
+ if (auto VAR = (EXPR); !(VAR == EQ)) { \
+ BOOST_CHECK_EQUAL(VAR, EQ); \
+ } \
+ else
+
#endif