Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Fix SelfTest compilation after _THROWS_ assertion change

That is, changes made in efd79aa0bdeb7d02be2d9b3db01685c7f0467568
Commit
d7f754dc4934efb898e6d70e66d19302cf9a5a4b
Author
Martin Hořeňovský ·
Parents
a14bd08b2766

Files · Download .tar.gz

Changes

 projects/SelfTest/CompilationTests.cpp |  2 +-
 projects/SelfTest/MatchersTests.cpp    | 16 ++++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/projects/SelfTest/CompilationTests.cpp b/projects/SelfTest/CompilationTests.cpp
index 3298c79e..e6c31f65 100644
--- a/projects/SelfTest/CompilationTests.cpp
+++ b/projects/SelfTest/CompilationTests.cpp
@@ -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;
diff --git a/projects/SelfTest/MatchersTests.cpp b/projects/SelfTest/MatchersTests.cpp
index 5984eb3a..a4f8a45f 100644
--- a/projects/SelfTest/MatchersTests.cpp
+++ b/projects/SelfTest/MatchersTests.cpp
@@ -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 });
     }
 }