diff options
author | Mattes D <github@xoft.cz> | 2019-09-02 06:46:40 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2019-09-06 16:12:33 +0200 |
commit | d8d1e6e1d2f668cb7b34eae7484e59e2310e847a (patch) | |
tree | b0465a99b335bdd509fb40adf5cca950997170b7 /tests/TestHelpers.h | |
parent | Moved the generator defaults to ComposableGenerator. (diff) | |
download | cuberite-d8d1e6e1d2f668cb7b34eae7484e59e2310e847a.tar cuberite-d8d1e6e1d2f668cb7b34eae7484e59e2310e847a.tar.gz cuberite-d8d1e6e1d2f668cb7b34eae7484e59e2310e847a.tar.bz2 cuberite-d8d1e6e1d2f668cb7b34eae7484e59e2310e847a.tar.lz cuberite-d8d1e6e1d2f668cb7b34eae7484e59e2310e847a.tar.xz cuberite-d8d1e6e1d2f668cb7b34eae7484e59e2310e847a.tar.zst cuberite-d8d1e6e1d2f668cb7b34eae7484e59e2310e847a.zip |
Diffstat (limited to 'tests/TestHelpers.h')
-rw-r--r-- | tests/TestHelpers.h | 12 |
1 files changed, 11 insertions, 1 deletions
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 (...) \ |