From f1ba61c7ba5989373880f14f80d2b56f8593eb81 Mon Sep 17 00:00:00 2001 From: "Philipp A. Hartmann" Date: Sun, 9 Jul 2017 14:31:29 +0200 Subject: [PATCH] unittest.h: change RAPIDJSON_ASSERT to allow usage in expressions --- test/unittest/unittest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unittest/unittest.h b/test/unittest/unittest.h index 5837345..aa091aa 100644 --- a/test/unittest/unittest.h +++ b/test/unittest/unittest.h @@ -117,7 +117,7 @@ public: #pragma GCC diagnostic pop #endif -#define RAPIDJSON_ASSERT(x) if (!(x)) throw AssertException(RAPIDJSON_STRINGIFY(x)) +#define RAPIDJSON_ASSERT(x) (!(x) ? throw AssertException(RAPIDJSON_STRINGIFY(x)) : (void)0u) class Random { public: