Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/projects
diff options
context:
space:
mode:
authorPhil Nash2014-04-12 19:20:46 +0100
committerPhil Nash2014-04-12 19:20:46 +0100
commit1bccc03213b374e30b7bcfddcddffa8d7de1b680 (patch)
treec08d73d93e867be18d7a115ddcb23109d277e7fb /projects
parenta176b9373813b4763a7815791097e45f6aa623c8 (diff)
downloadcatch3-1bccc03213b374e30b7bcfddcddffa8d7de1b680.tar.gz
Secondary fix for #270 (addresses same issue with CHECK)
Diffstat (limited to 'projects')
-rw-r--r--projects/SelfTest/Baselines/console.std.approved.txt17
-rw-r--r--projects/SelfTest/Baselines/console.sw.approved.txt17
-rw-r--r--projects/SelfTest/Baselines/junit.sw.approved.txt10
-rw-r--r--projects/SelfTest/Baselines/xml.sw.approved.txt20
-rw-r--r--projects/SelfTest/ExceptionTests.cpp8
5 files changed, 62 insertions, 10 deletions
diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt
index 20634449..5f23df59 100644
--- a/projects/SelfTest/Baselines/console.std.approved.txt
+++ b/projects/SelfTest/Baselines/console.std.approved.txt
@@ -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>
...............................................................................
@@ -343,6 +344,18 @@ 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
-------------------------------------------------------------------------------
ExceptionTests.cpp:<line number>
@@ -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)
diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt
index 0999e0f8..12f74797 100644
--- a/projects/SelfTest/Baselines/console.sw.approved.txt
+++ b/projects/SelfTest/Baselines/console.sw.approved.txt
@@ -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>
...............................................................................
@@ -1122,6 +1123,18 @@ 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
-------------------------------------------------------------------------------
ExceptionTests.cpp:<line number>
@@ -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)
diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt
index 7e171097..90b2c6c3 100644
--- a/projects/SelfTest/Baselines/junit.sw.approved.txt
+++ b/projects/SelfTest/Baselines/junit.sw.approved.txt
@@ -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,12 +210,18 @@ 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>
<testcase classname="global" name="Unexpected custom exceptions can be translated" time="{duration}">
<error type="TEST_CASE">
custom exception
diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt
index c1cabda3..ada68ac3 100644
--- a/projects/SelfTest/Baselines/xml.sw.approved.txt
+++ b/projects/SelfTest/Baselines/xml.sw.approved.txt
@@ -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&quot;
</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>
diff --git a/projects/SelfTest/ExceptionTests.cpp b/projects/SelfTest/ExceptionTests.cpp
index a193b226..9a325c55 100644
--- a/projects/SelfTest/ExceptionTests.cpp
+++ b/projects/SelfTest/ExceptionTests.cpp
@@ -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