diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt index a7d9e2a3..fe760fd7 100644 --- a/projects/SelfTest/Baselines/console.std.approved.txt +++ b/projects/SelfTest/Baselines/console.std.approved.txt @@ -3,6 +3,19 @@ is a host application. Run with -? for options +------------------------------------------------------------------------------- +#748 - captures with unexpected exceptions + inside REQUIRE_NOTHROW +------------------------------------------------------------------------------- +ExceptionTests.cpp: +............................................................................... + +ExceptionTests.cpp:: FAILED: + REQUIRE_NOTHROW( thisThrows() ) +due to unexpected exception with messages: + answer := 42 + expected exception + ------------------------------------------------------------------------------- #835 -- errno should not be touched by Catch ------------------------------------------------------------------------------- @@ -102,17 +115,6 @@ TrickyTests.cpp:: FAILED: with expansion: {?} == {?} -------------------------------------------------------------------------------- -An unchecked exception reports the line of the last assertion -------------------------------------------------------------------------------- -ExceptionTests.cpp: -............................................................................... - -ExceptionTests.cpp:: FAILED: - {Unknown expression after the reported line} -due to unexpected exception with message: - unexpected exception - ------------------------------------------------------------------------------- Contains string matcher ------------------------------------------------------------------------------- @@ -146,16 +148,6 @@ ExceptionTests.cpp:: FAILED: due to unexpected exception with message: custom exception - not std -------------------------------------------------------------------------------- -Custom std-exceptions can be custom translated -------------------------------------------------------------------------------- -ExceptionTests.cpp: -............................................................................... - -ExceptionTests.cpp:: FAILED: -due to unexpected exception with message: - custom std exception - ------------------------------------------------------------------------------- EndsWith string matcher ------------------------------------------------------------------------------- @@ -421,16 +413,6 @@ MiscTests.cpp:: warning: This one ran -------------------------------------------------------------------------------- -Non-std exceptions can be translated -------------------------------------------------------------------------------- -ExceptionTests.cpp: -............................................................................... - -ExceptionTests.cpp:: FAILED: -due to unexpected exception with message: - custom exception - ------------------------------------------------------------------------------- Ordering comparison checks that should fail ------------------------------------------------------------------------------- @@ -617,16 +599,6 @@ with expansion: } " -------------------------------------------------------------------------------- -Unexpected exceptions can be translated -------------------------------------------------------------------------------- -ExceptionTests.cpp: -............................................................................... - -ExceptionTests.cpp:: FAILED: -due to unexpected exception with message: - 3.14 - ------------------------------------------------------------------------------- Vector matchers that fail Contains (element) @@ -688,16 +660,6 @@ MatchersTests.cpp:: FAILED: with expansion: { 1, 2, 3 } Equals: { } -------------------------------------------------------------------------------- -When unchecked exceptions are thrown directly they are always failures -------------------------------------------------------------------------------- -ExceptionTests.cpp: -............................................................................... - -ExceptionTests.cpp:: FAILED: -due to unexpected exception with message: - unexpected exception - ------------------------------------------------------------------------------- When unchecked exceptions are thrown during a CHECK the test should continue ------------------------------------------------------------------------------- @@ -732,17 +694,6 @@ ExceptionTests.cpp:: FAILED: due to unexpected exception with message: expected exception -------------------------------------------------------------------------------- -When unchecked exceptions are thrown from sections they are always failures - section name -------------------------------------------------------------------------------- -ExceptionTests.cpp: -............................................................................... - -ExceptionTests.cpp:: FAILED: -due to unexpected exception with message: - unexpected exception - ------------------------------------------------------------------------------- Where the LHS is not a simple value ------------------------------------------------------------------------------- @@ -915,6 +866,6 @@ with expansion: "first" == "second" =============================================================================== -test cases: 166 | 119 passed | 44 failed | 3 failed as expected -assertions: 961 | 855 passed | 87 failed | 19 failed as expected +test cases: 167 | 125 passed | 38 failed | 4 failed as expected +assertions: 960 | 859 passed | 81 failed | 20 failed as expected diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt index b8b3cb47..954e80e6 100644 --- a/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/projects/SelfTest/Baselines/console.sw.approved.txt @@ -15,26 +15,30 @@ with message: yay ------------------------------------------------------------------------------- -#542 +#748 - captures with unexpected exceptions + inside REQUIRE_NOTHROW ------------------------------------------------------------------------------- -CompilationTests.cpp: +ExceptionTests.cpp: ............................................................................... -CompilationTests.cpp:: -PASSED: - CHECK_THROWS_AS( throws_int(true), int ) +ExceptionTests.cpp:: FAILED: + REQUIRE_NOTHROW( thisThrows() ) +due to unexpected exception with messages: + answer := 42 + expected exception -CompilationTests.cpp:: -PASSED: - CHECK_THROWS_AS( throws_int(true), int& ) +------------------------------------------------------------------------------- +#748 - captures with unexpected exceptions + inside REQUIRE_THROWS +------------------------------------------------------------------------------- +ExceptionTests.cpp: +............................................................................... -CompilationTests.cpp:: +ExceptionTests.cpp:: PASSED: - CHECK_THROWS_AS( throws_int(true), const int ) - -CompilationTests.cpp:: -PASSED: - CHECK_THROWS_AS( throws_int(true), const int& ) + REQUIRE_THROWS( thisThrows() ) +with message: + answer := 42 ------------------------------------------------------------------------------- #809 @@ -48,6 +52,48 @@ PASSED: with expansion: 42 == {?} +------------------------------------------------------------------------------- +#833 +------------------------------------------------------------------------------- +CompilationTests.cpp: +............................................................................... + +CompilationTests.cpp:: +PASSED: + REQUIRE( a == t ) +with expansion: + 3 == 3 + +CompilationTests.cpp:: +PASSED: + CHECK( a == t ) +with expansion: + 3 == 3 + +CompilationTests.cpp:: +PASSED: + REQUIRE_THROWS( throws_int(true) ) + +CompilationTests.cpp:: +PASSED: + CHECK_THROWS_AS( throws_int(true), const int& ) + +CompilationTests.cpp:: +PASSED: + REQUIRE_NOTHROW( throws_int(false) ) + +CompilationTests.cpp:: +PASSED: + REQUIRE_THAT( "aaa", Catch::EndsWith("aaa") ) +with expansion: + "aaa" ends with: "aaa" + +CompilationTests.cpp:: +PASSED: + REQUIRE( templated_tests(3) ) +with expansion: + true + ------------------------------------------------------------------------------- #835 -- errno should not be touched by Catch ------------------------------------------------------------------------------- @@ -398,11 +444,6 @@ ExceptionTests.cpp:: PASSED: CHECK( 1 == 1 ) -ExceptionTests.cpp:: FAILED: - {Unknown expression after the reported line} -due to unexpected exception with message: - unexpected exception - ------------------------------------------------------------------------------- Anonymous test case 1 ------------------------------------------------------------------------------- @@ -957,16 +998,6 @@ ExceptionTests.cpp:: FAILED: due to unexpected exception with message: custom exception - not std -------------------------------------------------------------------------------- -Custom std-exceptions can be custom translated -------------------------------------------------------------------------------- -ExceptionTests.cpp: -............................................................................... - -ExceptionTests.cpp:: FAILED: -due to unexpected exception with message: - custom std exception - ------------------------------------------------------------------------------- Demonstrate that a non-const == is not used ------------------------------------------------------------------------------- @@ -4477,16 +4508,6 @@ MiscTests.cpp:: warning: This one ran -------------------------------------------------------------------------------- -Non-std exceptions can be translated -------------------------------------------------------------------------------- -ExceptionTests.cpp: -............................................................................... - -ExceptionTests.cpp:: FAILED: -due to unexpected exception with message: - custom exception - ------------------------------------------------------------------------------- NotImplemented exception ------------------------------------------------------------------------------- @@ -6807,7 +6828,8 @@ PASSED: with expansion: "error: tag alias, "[@zzz]" already registered. First seen at file:2 - Redefined at file:10" contains: "[@zzz]" + Redefined at file:10 + " contains: "[@zzz]" TagAliasTests.cpp:: PASSED: @@ -6815,7 +6837,8 @@ PASSED: with expansion: "error: tag alias, "[@zzz]" already registered. First seen at file:2 - Redefined at file:10" contains: "file" + Redefined at file:10 + " contains: "file" TagAliasTests.cpp:: PASSED: @@ -6823,7 +6846,8 @@ PASSED: with expansion: "error: tag alias, "[@zzz]" already registered. First seen at file:2 - Redefined at file:10" contains: "2" + Redefined at file:10 + " contains: "2" TagAliasTests.cpp:: PASSED: @@ -6831,7 +6855,8 @@ PASSED: with expansion: "error: tag alias, "[@zzz]" already registered. First seen at file:2 - Redefined at file:10" contains: "10" + Redefined at file:10 + " contains: "10" ------------------------------------------------------------------------------- Tag alias can be registered against tag patterns @@ -7920,16 +7945,6 @@ PASSED: with expansion: true -------------------------------------------------------------------------------- -Unexpected exceptions can be translated -------------------------------------------------------------------------------- -ExceptionTests.cpp: -............................................................................... - -ExceptionTests.cpp:: FAILED: -due to unexpected exception with message: - 3.14 - ------------------------------------------------------------------------------- Use a custom approx ------------------------------------------------------------------------------- @@ -8150,16 +8165,6 @@ ExceptionTests.cpp:: PASSED: REQUIRE_THROWS( thisThrows() ) -------------------------------------------------------------------------------- -When unchecked exceptions are thrown directly they are always failures -------------------------------------------------------------------------------- -ExceptionTests.cpp: -............................................................................... - -ExceptionTests.cpp:: FAILED: -due to unexpected exception with message: - unexpected exception - ------------------------------------------------------------------------------- When unchecked exceptions are thrown during a CHECK the test should continue ------------------------------------------------------------------------------- @@ -8194,17 +8199,6 @@ ExceptionTests.cpp:: FAILED: due to unexpected exception with message: expected exception -------------------------------------------------------------------------------- -When unchecked exceptions are thrown from sections they are always failures - section name -------------------------------------------------------------------------------- -ExceptionTests.cpp: -............................................................................... - -ExceptionTests.cpp:: FAILED: -due to unexpected exception with message: - unexpected exception - ------------------------------------------------------------------------------- Where the LHS is not a simple value ------------------------------------------------------------------------------- @@ -9404,6 +9398,6 @@ MiscTests.cpp:: PASSED: =============================================================================== -test cases: 166 | 118 passed | 45 failed | 3 failed as expected -assertions: 963 | 855 passed | 89 failed | 19 failed as expected +test cases: 167 | 124 passed | 39 failed | 4 failed as expected +assertions: 962 | 859 passed | 83 failed | 20 failed as expected diff --git a/projects/SelfTest/Baselines/console.swa4.approved.txt b/projects/SelfTest/Baselines/console.swa4.approved.txt index aec6b675..e9a0cbb7 100644 --- a/projects/SelfTest/Baselines/console.swa4.approved.txt +++ b/projects/SelfTest/Baselines/console.swa4.approved.txt @@ -15,26 +15,30 @@ with message: yay ------------------------------------------------------------------------------- -#542 +#748 - captures with unexpected exceptions + inside REQUIRE_NOTHROW ------------------------------------------------------------------------------- -CompilationTests.cpp: +ExceptionTests.cpp: ............................................................................... -CompilationTests.cpp:: -PASSED: - CHECK_THROWS_AS( throws_int(true), int ) +ExceptionTests.cpp:: FAILED: + REQUIRE_NOTHROW( thisThrows() ) +due to unexpected exception with messages: + answer := 42 + expected exception -CompilationTests.cpp:: -PASSED: - CHECK_THROWS_AS( throws_int(true), int& ) +------------------------------------------------------------------------------- +#748 - captures with unexpected exceptions + inside REQUIRE_THROWS +------------------------------------------------------------------------------- +ExceptionTests.cpp: +............................................................................... -CompilationTests.cpp:: +ExceptionTests.cpp:: PASSED: - CHECK_THROWS_AS( throws_int(true), const int ) - -CompilationTests.cpp:: -PASSED: - CHECK_THROWS_AS( throws_int(true), const int& ) + REQUIRE_THROWS( thisThrows() ) +with message: + answer := 42 ------------------------------------------------------------------------------- #809 @@ -48,6 +52,48 @@ PASSED: with expansion: 42 == {?} +------------------------------------------------------------------------------- +#833 +------------------------------------------------------------------------------- +CompilationTests.cpp: +............................................................................... + +CompilationTests.cpp:: +PASSED: + REQUIRE( a == t ) +with expansion: + 3 == 3 + +CompilationTests.cpp:: +PASSED: + CHECK( a == t ) +with expansion: + 3 == 3 + +CompilationTests.cpp:: +PASSED: + REQUIRE_THROWS( throws_int(true) ) + +CompilationTests.cpp:: +PASSED: + CHECK_THROWS_AS( throws_int(true), const int& ) + +CompilationTests.cpp:: +PASSED: + REQUIRE_NOTHROW( throws_int(false) ) + +CompilationTests.cpp:: +PASSED: + REQUIRE_THAT( "aaa", Catch::EndsWith("aaa") ) +with expansion: + "aaa" ends with: "aaa" + +CompilationTests.cpp:: +PASSED: + REQUIRE( templated_tests(3) ) +with expansion: + true + ------------------------------------------------------------------------------- #835 -- errno should not be touched by Catch ------------------------------------------------------------------------------- @@ -86,6 +132,6 @@ ConditionTests.cpp:: FAILED: CHECK_FALSE( true ) =============================================================================== -test cases: 5 | 3 passed | 1 failed | 1 failed as expected -assertions: 12 | 7 passed | 4 failed | 1 failed as expected +test cases: 6 | 3 passed | 1 failed | 2 failed as expected +assertions: 17 | 11 passed | 4 failed | 2 failed as expected diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt index bb088e50..45ba1ad8 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,9 +1,17 @@ - + - + + +expected exception +answer := 42 +ExceptionTests.cpp: + + + + MiscTests.cpp: @@ -71,12 +79,7 @@ TrickyTests.cpp: - - -unexpected exception -ExceptionTests.cpp: - - + @@ -112,12 +115,6 @@ ExceptionTests.cpp: custom exception - not std -ExceptionTests.cpp: - - - - -custom std exception ExceptionTests.cpp: @@ -285,12 +282,6 @@ ExceptionTests.cpp: - - -custom exception -ExceptionTests.cpp: - - @@ -506,12 +497,6 @@ MiscTests.cpp: - - -3.14 -ExceptionTests.cpp: - - @@ -548,12 +533,6 @@ MatchersTests.cpp: - - -unexpected exception -ExceptionTests.cpp: - - expected exception @@ -569,12 +548,6 @@ ExceptionTests.cpp: expected exception -ExceptionTests.cpp: - - - - -unexpected exception ExceptionTests.cpp: diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index e7f3c4bb..526f68aa 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -4,39 +4,41 @@ - - - - throws_int(true), int - - - throws_int(true), int - - - - - throws_int(true), int& - - - throws_int(true), int& - - - - - throws_int(true), const int - - - throws_int(true), const int - - - - - throws_int(true), const int& - - - throws_int(true), const int& - - + +
+ +
+
+ + answer := 42 + + + + thisThrows() + + + thisThrows() + + + expected exception + + + +
+
+ + answer := 42 + + + + thisThrows() + + + thisThrows() + + + +
@@ -50,6 +52,65 @@ + + + + a == t + + + 3 == 3 + + + + + a == t + + + 3 == 3 + + + + + throws_int(true) + + + throws_int(true) + + + + + throws_int(true), const int& + + + throws_int(true), const int& + + + + + throws_int(false) + + + throws_int(false) + + + + + "aaa", Catch::EndsWith("aaa") + + + "aaa" ends with: "aaa" + + + + + templated_tests<int>(3) + + + true + + + + @@ -445,18 +506,7 @@ 1 == 1 - - - {Unknown expression after the reported line} - - - {Unknown expression after the reported line} - - - unexpected exception - - - + @@ -1060,10 +1110,7 @@ - - custom std exception - - + @@ -4588,10 +4635,7 @@ re>" - - custom exception - - + @@ -7308,7 +7352,8 @@ hello "error: tag alias, "[@zzz]" already registered. First seen at file:2 - Redefined at file:10" contains: "[@zzz]" + Redefined at file:10 +" contains: "[@zzz]" @@ -7318,7 +7363,8 @@ hello "error: tag alias, "[@zzz]" already registered. First seen at file:2 - Redefined at file:10" contains: "file" + Redefined at file:10 +" contains: "file" @@ -7328,7 +7374,8 @@ hello "error: tag alias, "[@zzz]" already registered. First seen at file:2 - Redefined at file:10" contains: "2" + Redefined at file:10 +" contains: "2" @@ -7338,7 +7385,8 @@ hello "error: tag alias, "[@zzz]" already registered. First seen at file:2 - Redefined at file:10" contains: "10" + Redefined at file:10 +" contains: "10" @@ -8538,10 +8586,7 @@ there" - - 3.14 - - + @@ -8804,10 +8849,7 @@ there" - - unexpected exception - - + @@ -8853,12 +8895,9 @@ there"
- - unexpected exception - - +
- +
@@ -10043,7 +10082,7 @@ spanner - + - +