Throw all exceptions with Arbutils exception.

This commit is contained in:
2020-08-15 14:50:17 +02:00
parent 3e96d2fd76
commit f158dbf8a2
6 changed files with 21 additions and 13 deletions

View File

@@ -8,8 +8,14 @@ TEST_CASE("Assert succeeds if true", "[Utilities]") { REQUIRE_NOTHROW(TestWrappe
TEST_CASE("Assert throws if false", "[Utilities]") { REQUIRE_THROWS(TestWrapper(false)); }
TEST_CASE("Assert throws if false with message", "[Utilities]") {
REQUIRE_THROWS_WITH(TestWrapper(false),
Catch::Matchers::Equals("ASSERTION FAILED: [AssertTests.cpp (3)] \"wrapperExpression\""));
try {
TestWrapper(false);
}
catch (const ArbUt::Exception& e) {
REQUIRE(strcmp(e.what(), "ASSERTION FAILED: [AssertTests.cpp (3)] \"wrapperExpression\"") == 0);
return;
}
throw ArbUt::Exception("Didn't throw.");
}
TEST_CASE("Multiple asserts", "[Utilities]") {