Commit 26caad3c authored by Mark Andrews's avatar Mark Andrews Committed by Ondřej Surý

simplify RUNTIME_CHECK for cppcheck

(cherry picked from commit 668a972d)
parent 3f68ed9a
......@@ -276,12 +276,17 @@ extern void mock_assert(const int result, const char* const expression,
#ifdef UNIT_TESTING
#define RUNTIME_CHECK(expression) \
mock_assert((int)(expression), #expression, __FILE__, __LINE__)
((!(expression)) ? \
(mock_assert(0, #expression, __FILE__, __LINE__), abort()) : (void)0)
#else /* UNIT_TESTING */
#ifndef CPPCHECK
/*% Runtime Check */
#define RUNTIME_CHECK(cond) ISC_ERROR_RUNTIMECHECK(cond)
#else
#define RUNTIME_CHECK(e) if (!(e)) abort()
#endif
#endif /* UNIT_TESTING */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment