diff --git a/src/lib/test/test-helper.hpp b/src/lib/test/test-helper.hpp index 115a44919..20f2b0891 100644 --- a/src/lib/test/test-helper.hpp +++ b/src/lib/test/test-helper.hpp @@ -341,16 +341,24 @@ operator""_expect (const char* lit, size_t siz) * an assertion failure. In case of an exception, the #lumiera_error * state is checked, cleared and verified. */ -#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT) \ - try \ - { \ - ERRONEOUS_STATEMENT ; \ - NOTREACHED("expected '%s' failure in: %s", \ - #ERROR_ID, #ERRONEOUS_STATEMENT); \ - } \ - catch (...) \ - { \ - CHECK (lumiera_error_expect (LUMIERA_ERROR_##ERROR_ID));\ +#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT) \ + try \ + { \ + ERRONEOUS_STATEMENT ; \ + NOTREACHED("expected '%s' failure in: %s", \ + #ERROR_ID, #ERRONEOUS_STATEMENT); \ + } \ + catch (lumiera::Error& ex) \ + { \ + CHECK (ex.getID() \ + == lib::test::ExpectString{LUMIERA_ERROR_##ERROR_ID} );\ + lumiera_error(); \ + } \ + catch (...) \ + { \ + CHECK (lumiera_error_peek() \ + == lib::test::ExpectString{LUMIERA_ERROR_##ERROR_ID} ); \ + lumiera_error(); \ }