From a1f4fd32a1790e569ccae3598cd9648bb25d13b6 Mon Sep 17 00:00:00 2001 From: David Steele Date: Fri, 19 Feb 2021 19:03:42 -0500 Subject: [PATCH] Add ASSERT_MSG(). Used when execution reaches an invalid location rather than an invalid condition. --- src/common/assert.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/assert.h b/src/common/assert.h index 2a4ce2abf..35cef2943 100644 --- a/src/common/assert.h +++ b/src/common/assert.h @@ -31,9 +31,14 @@ Asserts are used in test code to ensure that certain conditions are true. They #else #define ASSERT_INLINE(condition) #endif + + // Used when execution reaches an invalid location rather than an invalid condition + #define ASSERT_MSG(message) \ + THROW_FMT(AssertError, message); #else #define ASSERT(condition) #define ASSERT_INLINE(condition) + #define ASSERT_MSG(message) #endif /***********************************************************************************************************************************