unittest.h: change RAPIDJSON_ASSERT to allow usage in expressions

This commit is contained in:
Philipp A. Hartmann 2017-07-09 14:31:29 +02:00
parent 2f45319b4e
commit f1ba61c7ba

View File

@ -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: