From d8d1e6e1d2f668cb7b34eae7484e59e2310e847a Mon Sep 17 00:00:00 2001 From: Mattes D Date: Mon, 2 Sep 2019 06:46:40 +0200 Subject: Added a BasicGeneratorTest. --- tests/TestHelpers.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tests/TestHelpers.h') diff --git a/tests/TestHelpers.h b/tests/TestHelpers.h index 7a0725f66..b5c905f43 100644 --- a/tests/TestHelpers.h +++ b/tests/TestHelpers.h @@ -172,6 +172,14 @@ public: +/** Fails the test unconditionally, with the specified message. */ +#define TEST_FAIL(MSG) \ + throw TestException(__FILE__, __LINE__, __FUNCTION__, MSG); + + + + + /** Checks that the statement causes an ASSERT trigger. */ #ifdef _DEBUG #define TEST_ASSERTS(Stmt) TEST_THROWS(Stmt, cAssertFailure) @@ -210,7 +218,9 @@ int main() \ } \ catch (const cAssertFailure & exc) \ { \ - LOGERROR("Test has failed, an unexpected ASSERT was triggered at %s:%d", exc.fileName().c_str(), exc.lineNumber()); \ + LOGERROR("Test has failed, an unexpected ASSERT was triggered at %s:%d: %s", \ + exc.fileName().c_str(), exc.lineNumber(), exc.expression().c_str() \ + ); \ return 1; \ } \ catch (...) \ -- cgit v1.2.3