Added approvals for “failed as expected” tests

This commit is contained in:
Phil Nash
2017-04-07 09:33:19 +01:00
parent 09e4830199
commit 250f0ee7fb
5 changed files with 269 additions and 266 deletions

View File

@@ -15,26 +15,30 @@ with message:
yay
-------------------------------------------------------------------------------
#542
#748 - captures with unexpected exceptions
inside REQUIRE_NOTHROW
-------------------------------------------------------------------------------
CompilationTests.cpp:<line number>
ExceptionTests.cpp:<line number>
...............................................................................
CompilationTests.cpp:<line number>:
PASSED:
CHECK_THROWS_AS( throws_int(true), int )
ExceptionTests.cpp:<line number>: FAILED:
REQUIRE_NOTHROW( thisThrows() )
due to unexpected exception with messages:
answer := 42
expected exception
CompilationTests.cpp:<line number>:
PASSED:
CHECK_THROWS_AS( throws_int(true), int& )
-------------------------------------------------------------------------------
#748 - captures with unexpected exceptions
inside REQUIRE_THROWS
-------------------------------------------------------------------------------
ExceptionTests.cpp:<line number>
...............................................................................
CompilationTests.cpp:<line number>:
ExceptionTests.cpp:<line number>:
PASSED:
CHECK_THROWS_AS( throws_int(true), const int )
CompilationTests.cpp:<line number>:
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:<line number>
...............................................................................
CompilationTests.cpp:<line number>:
PASSED:
REQUIRE( a == t )
with expansion:
3 == 3
CompilationTests.cpp:<line number>:
PASSED:
CHECK( a == t )
with expansion:
3 == 3
CompilationTests.cpp:<line number>:
PASSED:
REQUIRE_THROWS( throws_int(true) )
CompilationTests.cpp:<line number>:
PASSED:
CHECK_THROWS_AS( throws_int(true), const int& )
CompilationTests.cpp:<line number>:
PASSED:
REQUIRE_NOTHROW( throws_int(false) )
CompilationTests.cpp:<line number>:
PASSED:
REQUIRE_THAT( "aaa", Catch::EndsWith("aaa") )
with expansion:
"aaa" ends with: "aaa"
CompilationTests.cpp:<line number>:
PASSED:
REQUIRE( templated_tests<int>(3) )
with expansion:
true
-------------------------------------------------------------------------------
#835 -- errno should not be touched by Catch
-------------------------------------------------------------------------------
@@ -398,11 +444,6 @@ ExceptionTests.cpp:<line number>:
PASSED:
CHECK( 1 == 1 )
ExceptionTests.cpp:<line number>: 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:<line number>: FAILED:
due to unexpected exception with message:
custom exception - not std
-------------------------------------------------------------------------------
Custom std-exceptions can be custom translated
-------------------------------------------------------------------------------
ExceptionTests.cpp:<line number>
...............................................................................
ExceptionTests.cpp:<line number>: FAILED:
due to unexpected exception with message:
custom std exception
-------------------------------------------------------------------------------
Demonstrate that a non-const == is not used
-------------------------------------------------------------------------------
@@ -4477,16 +4508,6 @@ MiscTests.cpp:<line number>:
warning:
This one ran
-------------------------------------------------------------------------------
Non-std exceptions can be translated
-------------------------------------------------------------------------------
ExceptionTests.cpp:<line number>
...............................................................................
ExceptionTests.cpp:<line number>: 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:<line number>:
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:<line number>:
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:<line number>:
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:<line number>
...............................................................................
ExceptionTests.cpp:<line number>: FAILED:
due to unexpected exception with message:
3.14
-------------------------------------------------------------------------------
Use a custom approx
-------------------------------------------------------------------------------
@@ -8150,16 +8165,6 @@ ExceptionTests.cpp:<line number>:
PASSED:
REQUIRE_THROWS( thisThrows() )
-------------------------------------------------------------------------------
When unchecked exceptions are thrown directly they are always failures
-------------------------------------------------------------------------------
ExceptionTests.cpp:<line number>
...............................................................................
ExceptionTests.cpp:<line number>: 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:<line number>: FAILED:
due to unexpected exception with message:
expected exception
-------------------------------------------------------------------------------
When unchecked exceptions are thrown from sections they are always failures
section name
-------------------------------------------------------------------------------
ExceptionTests.cpp:<line number>
...............................................................................
ExceptionTests.cpp:<line number>: FAILED:
due to unexpected exception with message:
unexpected exception
-------------------------------------------------------------------------------
Where the LHS is not a simple value
-------------------------------------------------------------------------------
@@ -9404,6 +9398,6 @@ MiscTests.cpp:<line number>:
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