Fix SelfTest compilation after _THROWS_ assertion change

That is, changes made in efd79aa0bd
This commit is contained in:
Martin Hořeňovský 2017-07-19 22:21:25 +02:00
parent a14bd08b27
commit d7f754dc49
2 changed files with 9 additions and 9 deletions

View File

@ -41,7 +41,7 @@ bool templated_tests(T t) {
REQUIRE(a == t);
CHECK(a == t);
REQUIRE_THROWS(throws_int(true));
CHECK_THROWS_AS(throws_int(true), const int&);
CHECK_THROWS_AS(throws_int(true), int);
REQUIRE_NOTHROW(throws_int(false));
REQUIRE_THAT("aaa", Catch::EndsWith("aaa"));
return true;

View File

@ -205,21 +205,21 @@ public:
TEST_CASE( "Exception matchers that succeed", "[matchers][exceptions][!throws]" ) {
CHECK_THROWS_MATCHES(throws(1), SpecialException const&, ExceptionMatcher{ 1 });
REQUIRE_THROWS_MATCHES(throws(2), SpecialException const&, ExceptionMatcher{ 2 });
CHECK_THROWS_MATCHES(throws(1), SpecialException, ExceptionMatcher{ 1 });
REQUIRE_THROWS_MATCHES(throws(2), SpecialException, ExceptionMatcher{ 2 });
}
TEST_CASE("Exception matchers that fail", "[matchers][exceptions][!throws][.failing]") {
SECTION("No exception") {
CHECK_THROWS_MATCHES(doesNotThrow(), SpecialException const&, ExceptionMatcher{ 1 });
REQUIRE_THROWS_MATCHES(doesNotThrow(), SpecialException const&, ExceptionMatcher{ 1 });
CHECK_THROWS_MATCHES(doesNotThrow(), SpecialException, ExceptionMatcher{ 1 });
REQUIRE_THROWS_MATCHES(doesNotThrow(), SpecialException, ExceptionMatcher{ 1 });
}
SECTION("Type mismatch") {
CHECK_THROWS_MATCHES(throwsAsInt(1), SpecialException const&, ExceptionMatcher{ 1 });
REQUIRE_THROWS_MATCHES(throwsAsInt(1), SpecialException const&, ExceptionMatcher{ 1 });
CHECK_THROWS_MATCHES(throwsAsInt(1), SpecialException, ExceptionMatcher{ 1 });
REQUIRE_THROWS_MATCHES(throwsAsInt(1), SpecialException, ExceptionMatcher{ 1 });
}
SECTION("Contents are wrong") {
CHECK_THROWS_MATCHES(throws(3), SpecialException const&, ExceptionMatcher{ 1 });
REQUIRE_THROWS_MATCHES(throws(4), SpecialException const&, ExceptionMatcher{ 1 });
CHECK_THROWS_MATCHES(throws(3), SpecialException, ExceptionMatcher{ 1 });
REQUIRE_THROWS_MATCHES(throws(4), SpecialException, ExceptionMatcher{ 1 });
}
}