mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 12:17:11 +01:00 
			
		
		
		
	Secondary fix for #270 (addresses same issue with CHECK)
This commit is contained in:
		| @@ -332,7 +332,8 @@ due to unexpected exception with message: | ||||
|   expected exception | ||||
|  | ||||
| ------------------------------------------------------------------------------- | ||||
| When unchecked exceptions are thrown during a require the test should fail | ||||
| When unchecked exceptions are thrown during a REQUIRE the test should abort | ||||
| fail | ||||
| ------------------------------------------------------------------------------- | ||||
| ExceptionTests.cpp:<line number> | ||||
| ............................................................................... | ||||
| @@ -342,6 +343,18 @@ ExceptionTests.cpp:<line number>: FAILED: | ||||
| due to unexpected exception with message: | ||||
|   expected exception | ||||
|  | ||||
| ------------------------------------------------------------------------------- | ||||
| When unchecked exceptions are thrown during a CHECK the test should abort and | ||||
| fail | ||||
| ------------------------------------------------------------------------------- | ||||
| ExceptionTests.cpp:<line number> | ||||
| ............................................................................... | ||||
|  | ||||
| ExceptionTests.cpp:<line number>: FAILED: | ||||
|   CHECK( thisThrows() == 0 ) | ||||
| due to unexpected exception with message: | ||||
|   expected exception | ||||
|  | ||||
| ------------------------------------------------------------------------------- | ||||
| Unexpected custom exceptions can be translated | ||||
| ------------------------------------------------------------------------------- | ||||
| @@ -761,5 +774,5 @@ with expansion: | ||||
|   "first" == "second" | ||||
|  | ||||
| =============================================================================== | ||||
| 123 test cases - 37 failed (659 assertions - 92 failed) | ||||
| 124 test cases - 38 failed (660 assertions - 93 failed) | ||||
|  | ||||
|   | ||||
| @@ -1111,7 +1111,8 @@ due to unexpected exception with message: | ||||
|   expected exception | ||||
|  | ||||
| ------------------------------------------------------------------------------- | ||||
| When unchecked exceptions are thrown during a require the test should fail | ||||
| When unchecked exceptions are thrown during a REQUIRE the test should abort | ||||
| fail | ||||
| ------------------------------------------------------------------------------- | ||||
| ExceptionTests.cpp:<line number> | ||||
| ............................................................................... | ||||
| @@ -1121,6 +1122,18 @@ ExceptionTests.cpp:<line number>: FAILED: | ||||
| due to unexpected exception with message: | ||||
|   expected exception | ||||
|  | ||||
| ------------------------------------------------------------------------------- | ||||
| When unchecked exceptions are thrown during a CHECK the test should abort and | ||||
| fail | ||||
| ------------------------------------------------------------------------------- | ||||
| ExceptionTests.cpp:<line number> | ||||
| ............................................................................... | ||||
|  | ||||
| ExceptionTests.cpp:<line number>: FAILED: | ||||
|   CHECK( thisThrows() == 0 ) | ||||
| due to unexpected exception with message: | ||||
|   expected exception | ||||
|  | ||||
| ------------------------------------------------------------------------------- | ||||
| When unchecked exceptions are thrown, but caught, they do not affect the test | ||||
| ------------------------------------------------------------------------------- | ||||
| @@ -6969,5 +6982,5 @@ with expansion: | ||||
|   true | ||||
|  | ||||
| =============================================================================== | ||||
| 123 test cases - 52 failed (678 assertions - 111 failed) | ||||
| 124 test cases - 53 failed (679 assertions - 112 failed) | ||||
|  | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| <testsuites> | ||||
|   <testsuite name="~_" errors="11" failures="100" tests="678" hostname="tbd" time="{duration}" timestamp="tbd"> | ||||
|   <testsuite name="~_" errors="12" failures="100" tests="679" hostname="tbd" time="{duration}" timestamp="tbd"> | ||||
|     <testcase classname="global" name="Some simple comparisons between doubles" time="{duration}"/> | ||||
|     <testcase classname="global" name="Approximate comparisons with different epsilons" time="{duration}"/> | ||||
|     <testcase classname="global" name="Approximate comparisons with floats" time="{duration}"/> | ||||
| @@ -210,9 +210,15 @@ expected exception | ||||
| ExceptionTests.cpp:<line number> | ||||
|       </error> | ||||
|     </testcase> | ||||
|     <testcase classname="global" name="When unchecked exceptions are thrown during a require the test should fail" time="{duration}"> | ||||
|     <testcase classname="global" name="When unchecked exceptions are thrown during a REQUIRE the test should abort fail" time="{duration}"> | ||||
|       <error message="thisThrows() == 0" type="REQUIRE"> | ||||
| expected exception | ||||
| ExceptionTests.cpp:<line number> | ||||
|       </error> | ||||
|     </testcase> | ||||
|     <testcase classname="global" name="When unchecked exceptions are thrown during a CHECK the test should abort and fail" time="{duration}"> | ||||
|       <error message="thisThrows() == 0" type="CHECK"> | ||||
| expected exception | ||||
| ExceptionTests.cpp:<line number> | ||||
|       </error> | ||||
|     </testcase> | ||||
|   | ||||
| @@ -1426,7 +1426,21 @@ | ||||
|       </Expression> | ||||
|       <OverallResult success="false"/> | ||||
|     </TestCase> | ||||
|     <TestCase name="When unchecked exceptions are thrown during a require the test should fail"> | ||||
|     <TestCase name="When unchecked exceptions are thrown during a REQUIRE the test should abort fail"> | ||||
|       <Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ExceptionTests.cpp" > | ||||
|         <Original> | ||||
|           thisThrows() == 0 | ||||
|         </Original> | ||||
|         <Expanded> | ||||
|           thisThrows() == 0 | ||||
|         </Expanded> | ||||
|         <Exception filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ExceptionTests.cpp" > | ||||
|           expected exception | ||||
|         </Exception> | ||||
|       </Expression> | ||||
|       <OverallResult success="false"/> | ||||
|     </TestCase> | ||||
|     <TestCase name="When unchecked exceptions are thrown during a CHECK the test should abort and fail"> | ||||
|       <Expression success="false" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/ExceptionTests.cpp" > | ||||
|         <Original> | ||||
|           thisThrows() == 0 | ||||
| @@ -7228,7 +7242,7 @@ there" | ||||
|       </Section> | ||||
|       <OverallResult success="true"/> | ||||
|     </TestCase> | ||||
|     <OverallResults successes="567" failures="111"/> | ||||
|     <OverallResults successes="567" failures="112"/> | ||||
|   </Group> | ||||
|   <OverallResults successes="567" failures="111"/> | ||||
|   <OverallResults successes="567" failures="112"/> | ||||
| </Catch> | ||||
|   | ||||
| @@ -66,12 +66,18 @@ TEST_CASE( "When unchecked exceptions are thrown from functions they are always | ||||
|     CHECK( thisThrows() == 0 ); | ||||
| } | ||||
|  | ||||
| TEST_CASE( "When unchecked exceptions are thrown during a require the test should fail", "[.][failing]" ) | ||||
| TEST_CASE( "When unchecked exceptions are thrown during a REQUIRE the test should abort fail", "[.][failing]" ) | ||||
| { | ||||
|     REQUIRE( thisThrows() == 0 ); | ||||
|     FAIL( "This should never happen" ); | ||||
| } | ||||
|  | ||||
| TEST_CASE( "When unchecked exceptions are thrown during a CHECK the test should abort and fail", "[.][failing]" ) | ||||
| { | ||||
|     CHECK( thisThrows() == 0 ); | ||||
|     FAIL( "This should never happen" ); | ||||
| } | ||||
|  | ||||
| TEST_CASE( "When unchecked exceptions are thrown, but caught, they do not affect the test", "" ) | ||||
| { | ||||
|     try | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Phil Nash
					Phil Nash