2013-09-27 20:01:14 +02:00
|
|
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2017-01-09 15:33:03 +01:00
|
|
|
<exe-name> is a <version> host application.
|
2013-09-27 20:01:14 +02:00
|
|
|
Run with -? for options
|
|
|
|
|
2017-04-09 21:40:01 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
#748 - captures with unexpected exceptions
|
|
|
|
outside assertions
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
ExceptionTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
ExceptionTests.cpp:<line number>: FAILED:
|
|
|
|
due to unexpected exception with messages:
|
|
|
|
answer := 42
|
|
|
|
expected exception
|
|
|
|
|
2017-04-07 10:33:19 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
#748 - captures with unexpected exceptions
|
|
|
|
inside REQUIRE_NOTHROW
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
ExceptionTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
ExceptionTests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE_NOTHROW( thisThrows() )
|
|
|
|
due to unexpected exception with messages:
|
|
|
|
answer := 42
|
|
|
|
expected exception
|
|
|
|
|
2017-03-06 22:07:33 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
#835 -- errno should not be touched by Catch
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
MiscTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
MiscTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK( f() == 0 )
|
|
|
|
with expansion:
|
|
|
|
1 == 0
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
'Not' checks that should fail
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
ConditionTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK( false != false )
|
|
|
|
|
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK( true != true )
|
|
|
|
|
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK( !true )
|
|
|
|
with expansion:
|
|
|
|
false
|
|
|
|
|
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK_FALSE( true )
|
|
|
|
|
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK( !trueValue )
|
|
|
|
with expansion:
|
|
|
|
false
|
|
|
|
|
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK_FALSE( trueValue )
|
|
|
|
with expansion:
|
|
|
|
!true
|
|
|
|
|
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK( !(1 == 1) )
|
|
|
|
with expansion:
|
|
|
|
false
|
|
|
|
|
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK_FALSE( 1 == 1 )
|
|
|
|
with expansion:
|
|
|
|
!(1 == 1)
|
|
|
|
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2013-11-19 08:21:03 +01:00
|
|
|
A METHOD_AS_TEST_CASE based test run that fails
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2013-09-30 09:01:10 +02:00
|
|
|
ClassTests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ClassTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
REQUIRE( s == "world" )
|
|
|
|
with expansion:
|
|
|
|
"hello" == "world"
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
2013-11-19 08:21:03 +01:00
|
|
|
A TEST_CASE_METHOD based test run that fails
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2013-09-30 09:01:10 +02:00
|
|
|
ClassTests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ClassTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
REQUIRE( m_a == 2 )
|
|
|
|
with expansion:
|
|
|
|
1 == 2
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
A couple of nested sections followed by a failure
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
MiscTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
MiscTests.cpp:<line number>: FAILED:
|
|
|
|
explicitly with message:
|
|
|
|
to infinity and beyond
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
A failing expression with a non streamable type is still captured
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
TrickyTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
TrickyTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK( &o1 == &o2 )
|
|
|
|
with expansion:
|
|
|
|
0x<hex digits> == 0x<hex digits>
|
|
|
|
|
|
|
|
TrickyTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK( o1 == o2 )
|
|
|
|
with expansion:
|
|
|
|
{?} == {?}
|
|
|
|
|
2017-04-09 21:40:01 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
An unchecked exception reports the line of the last assertion
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
ExceptionTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
ExceptionTests.cpp:<line number>: FAILED:
|
|
|
|
{Unknown expression after the reported line}
|
|
|
|
due to unexpected exception with message:
|
|
|
|
unexpected exception
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Contains string matcher
|
|
|
|
-------------------------------------------------------------------------------
|
2017-02-21 15:19:09 +01:00
|
|
|
MatchersTests.cpp:<line number>
|
2016-11-29 12:32:16 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-02-21 15:19:09 +01:00
|
|
|
MatchersTests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
CHECK_THAT( testStringForMatching(), Contains( "not there" ) )
|
|
|
|
with expansion:
|
|
|
|
"this string contains 'abc' as a substring" contains: "not there"
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Custom exceptions can be translated when testing for nothrow
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
ExceptionTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
ExceptionTests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE_NOTHROW( throwCustom() )
|
|
|
|
due to unexpected exception with message:
|
|
|
|
custom exception - not std
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Custom exceptions can be translated when testing for throwing as something else
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
ExceptionTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
ExceptionTests.cpp:<line number>: FAILED:
|
2017-02-09 12:41:16 +01:00
|
|
|
REQUIRE_THROWS_AS( throwCustom(), std::exception )
|
2016-11-29 12:32:16 +01:00
|
|
|
due to unexpected exception with message:
|
|
|
|
custom exception - not std
|
|
|
|
|
2017-04-09 21:40:01 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
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
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
EndsWith string matcher
|
|
|
|
-------------------------------------------------------------------------------
|
2017-02-21 15:19:09 +01:00
|
|
|
MatchersTests.cpp:<line number>
|
2016-11-29 12:32:16 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-02-21 15:19:09 +01:00
|
|
|
MatchersTests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
CHECK_THAT( testStringForMatching(), EndsWith( "this" ) )
|
|
|
|
with expansion:
|
|
|
|
"this string contains 'abc' as a substring" ends with: "this"
|
|
|
|
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2014-05-20 19:11:43 +02:00
|
|
|
Equality checks that should fail
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.int_seven == 6 )
|
|
|
|
with expansion:
|
|
|
|
7 == 6
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.int_seven == 8 )
|
|
|
|
with expansion:
|
|
|
|
7 == 8
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.int_seven == 0 )
|
|
|
|
with expansion:
|
|
|
|
7 == 0
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.float_nine_point_one == Approx( 9.11f ) )
|
|
|
|
with expansion:
|
2014-07-09 19:16:40 +02:00
|
|
|
9.1f == Approx( 9.1099996567 )
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.float_nine_point_one == Approx( 9.0f ) )
|
|
|
|
with expansion:
|
2014-07-09 19:16:40 +02:00
|
|
|
9.1f == Approx( 9.0 )
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.float_nine_point_one == Approx( 1 ) )
|
|
|
|
with expansion:
|
2014-07-09 19:16:40 +02:00
|
|
|
9.1f == Approx( 1.0 )
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.float_nine_point_one == Approx( 0 ) )
|
|
|
|
with expansion:
|
2014-07-09 19:16:40 +02:00
|
|
|
9.1f == Approx( 0.0 )
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.double_pi == Approx( 3.1415 ) )
|
|
|
|
with expansion:
|
|
|
|
3.1415926535 == Approx( 3.1415 )
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello == "goodbye" )
|
|
|
|
with expansion:
|
|
|
|
"hello" == "goodbye"
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello == "hell" )
|
|
|
|
with expansion:
|
|
|
|
"hello" == "hell"
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello == "hello1" )
|
|
|
|
with expansion:
|
|
|
|
"hello" == "hello1"
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello.size() == 6 )
|
|
|
|
with expansion:
|
|
|
|
5 == 6
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( x == Approx( 1.301 ) )
|
|
|
|
with expansion:
|
|
|
|
1.3 == Approx( 1.301 )
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Equals string matcher
|
|
|
|
-------------------------------------------------------------------------------
|
2017-02-21 15:19:09 +01:00
|
|
|
MatchersTests.cpp:<line number>
|
2016-11-29 12:32:16 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-02-21 15:19:09 +01:00
|
|
|
MatchersTests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
CHECK_THAT( testStringForMatching(), Equals( "something else" ) )
|
|
|
|
with expansion:
|
|
|
|
"this string contains 'abc' as a substring" equals: "something else"
|
|
|
|
|
2017-06-06 15:07:57 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Exception matchers that fail
|
|
|
|
No exception
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
MatchersTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
MatchersTests.cpp:<line number>: FAILED:
|
2017-07-20 00:29:19 +02:00
|
|
|
CHECK_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } )
|
2017-06-06 15:07:57 +02:00
|
|
|
because no exception was thrown where one was expected:
|
|
|
|
|
|
|
|
MatchersTests.cpp:<line number>: FAILED:
|
2017-07-20 00:29:19 +02:00
|
|
|
REQUIRE_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } )
|
2017-06-06 15:07:57 +02:00
|
|
|
because no exception was thrown where one was expected:
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Exception matchers that fail
|
|
|
|
Type mismatch
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
MatchersTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
MatchersTests.cpp:<line number>: FAILED:
|
2017-07-20 00:29:19 +02:00
|
|
|
CHECK_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{ 1 } )
|
2017-06-06 15:07:57 +02:00
|
|
|
due to unexpected exception with message:
|
|
|
|
Unknown exception
|
|
|
|
|
|
|
|
MatchersTests.cpp:<line number>: FAILED:
|
2017-07-20 00:29:19 +02:00
|
|
|
REQUIRE_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{ 1 } )
|
2017-06-06 15:07:57 +02:00
|
|
|
due to unexpected exception with message:
|
|
|
|
Unknown exception
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Exception matchers that fail
|
|
|
|
Contents are wrong
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
MatchersTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
MatchersTests.cpp:<line number>: FAILED:
|
2017-07-20 00:29:19 +02:00
|
|
|
CHECK_THROWS_MATCHES( throws(3), SpecialException, ExceptionMatcher{ 1 } )
|
2017-06-06 15:07:57 +02:00
|
|
|
with expansion:
|
|
|
|
{?} special exception has value of 1
|
|
|
|
|
|
|
|
MatchersTests.cpp:<line number>: FAILED:
|
2017-07-20 00:29:19 +02:00
|
|
|
REQUIRE_THROWS_MATCHES( throws(4), SpecialException, ExceptionMatcher{ 1 } )
|
2017-06-06 15:07:57 +02:00
|
|
|
with expansion:
|
|
|
|
{?} special exception has value of 1
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Expected exceptions that don't throw or unexpected exceptions fail the test
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
ExceptionTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
ExceptionTests.cpp:<line number>: FAILED:
|
2017-02-09 12:41:16 +01:00
|
|
|
CHECK_THROWS_AS( thisThrows(), std::string )
|
2016-11-29 12:32:16 +01:00
|
|
|
due to unexpected exception with message:
|
|
|
|
expected exception
|
|
|
|
|
|
|
|
ExceptionTests.cpp:<line number>: FAILED:
|
2017-02-09 12:41:16 +01:00
|
|
|
CHECK_THROWS_AS( thisDoesntThrow(), std::domain_error )
|
2016-11-29 12:32:16 +01:00
|
|
|
because no exception was thrown where one was expected:
|
|
|
|
|
|
|
|
ExceptionTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK_NOTHROW( thisThrows() )
|
|
|
|
due to unexpected exception with message:
|
|
|
|
expected exception
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
FAIL aborts the test
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
MessageTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
MessageTests.cpp:<line number>: FAILED:
|
|
|
|
explicitly with message:
|
|
|
|
This is a failure
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
FAIL does not require an argument
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
MessageTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
MessageTests.cpp:<line number>: FAILED:
|
|
|
|
|
2017-03-08 16:40:20 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
FAIL_CHECK does not abort the test
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
MessageTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
MessageTests.cpp:<line number>: FAILED:
|
|
|
|
explicitly with message:
|
|
|
|
This is a failure
|
|
|
|
|
|
|
|
MessageTests.cpp:<line number>:
|
|
|
|
warning:
|
|
|
|
This message appears in the output
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
INFO and WARN do not abort tests
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
MessageTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
MessageTests.cpp:<line number>:
|
|
|
|
warning:
|
|
|
|
this is a warning
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
INFO gets logged on failure
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
MessageTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
MessageTests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( a == 1 )
|
|
|
|
with expansion:
|
|
|
|
2 == 1
|
|
|
|
with messages:
|
|
|
|
this message should be logged
|
|
|
|
so should this
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
INFO gets logged on failure, even if captured before successful assertions
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
MessageTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
MessageTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK( a == 1 )
|
|
|
|
with expansion:
|
|
|
|
2 == 1
|
|
|
|
with messages:
|
|
|
|
this message may be logged later
|
|
|
|
this message should be logged
|
|
|
|
|
|
|
|
MessageTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK( a == 0 )
|
|
|
|
with expansion:
|
|
|
|
2 == 0
|
2017-06-06 15:07:57 +02:00
|
|
|
with messages:
|
|
|
|
this message may be logged later
|
|
|
|
this message should be logged
|
2016-11-29 12:32:16 +01:00
|
|
|
and this, but later
|
|
|
|
|
2017-08-10 17:06:32 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
INFO is reset for each loop
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
MessageTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
MessageTests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( i < 10 )
|
|
|
|
with expansion:
|
|
|
|
10 < 10
|
|
|
|
with messages:
|
|
|
|
current counter 10
|
|
|
|
i := 10
|
|
|
|
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2014-05-20 19:11:43 +02:00
|
|
|
Inequality checks that should fail
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.int_seven != 7 )
|
|
|
|
with expansion:
|
|
|
|
7 != 7
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.float_nine_point_one != Approx( 9.1f ) )
|
|
|
|
with expansion:
|
2014-07-09 19:16:40 +02:00
|
|
|
9.1f != Approx( 9.1000003815 )
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.double_pi != Approx( 3.1415926535 ) )
|
|
|
|
with expansion:
|
2013-12-19 19:41:55 +01:00
|
|
|
3.1415926535 != Approx( 3.1415926535 )
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello != "hello" )
|
|
|
|
with expansion:
|
|
|
|
"hello" != "hello"
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello.size() != 5 )
|
|
|
|
with expansion:
|
|
|
|
5 != 5
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
2016-11-29 12:32:16 +01:00
|
|
|
Matchers can be composed with both && and || - failing
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2017-02-21 15:19:09 +01:00
|
|
|
MatchersTests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-02-21 15:19:09 +01:00
|
|
|
MatchersTests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
CHECK_THAT( testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" ) )
|
2013-09-27 20:01:14 +02:00
|
|
|
with expansion:
|
2016-11-29 12:32:16 +01:00
|
|
|
"this string contains 'abc' as a substring" ( ( contains: "string" or
|
|
|
|
contains: "different" ) and contains: "random" )
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Matchers can be negated (Not) with the ! operator - failing
|
|
|
|
-------------------------------------------------------------------------------
|
2017-02-21 15:19:09 +01:00
|
|
|
MatchersTests.cpp:<line number>
|
2016-11-29 12:32:16 +01:00
|
|
|
...............................................................................
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2017-02-21 15:19:09 +01:00
|
|
|
MatchersTests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
CHECK_THAT( testStringForMatching(), !Contains( "substring" ) )
|
2013-09-27 20:01:14 +02:00
|
|
|
with expansion:
|
2016-11-29 12:32:16 +01:00
|
|
|
"this string contains 'abc' as a substring" not contains: "substring"
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Mismatching exception messages failing the test
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
ExceptionTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
ExceptionTests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE_THROWS_WITH( thisThrows(), "should fail" )
|
|
|
|
with expansion:
|
2017-08-09 01:44:30 +02:00
|
|
|
"expected exception" equals: "should fail"
|
2016-11-29 12:32:16 +01:00
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Nice descriptive name
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
MiscTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
MiscTests.cpp:<line number>:
|
|
|
|
warning:
|
|
|
|
This one ran
|
|
|
|
|
2017-04-09 21:40:01 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Non-std exceptions can be translated
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
ExceptionTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
ExceptionTests.cpp:<line number>: FAILED:
|
|
|
|
due to unexpected exception with message:
|
|
|
|
custom exception
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Ordering comparison checks that should fail
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
ConditionTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK( data.int_seven > 7 )
|
|
|
|
with expansion:
|
|
|
|
7 > 7
|
|
|
|
|
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK( data.int_seven < 7 )
|
|
|
|
with expansion:
|
|
|
|
7 < 7
|
|
|
|
|
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK( data.int_seven > 8 )
|
|
|
|
with expansion:
|
|
|
|
7 > 8
|
|
|
|
|
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK( data.int_seven < 6 )
|
|
|
|
with expansion:
|
|
|
|
7 < 6
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.int_seven < 0 )
|
|
|
|
with expansion:
|
|
|
|
7 < 0
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.int_seven < -1 )
|
|
|
|
with expansion:
|
|
|
|
7 < -1
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.int_seven >= 8 )
|
|
|
|
with expansion:
|
|
|
|
7 >= 8
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.int_seven <= 6 )
|
|
|
|
with expansion:
|
|
|
|
7 <= 6
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.float_nine_point_one < 9 )
|
|
|
|
with expansion:
|
2014-07-09 19:16:40 +02:00
|
|
|
9.1f < 9
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.float_nine_point_one > 10 )
|
|
|
|
with expansion:
|
2014-07-09 19:16:40 +02:00
|
|
|
9.1f > 10
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.float_nine_point_one > 9.2 )
|
|
|
|
with expansion:
|
2014-07-09 19:16:40 +02:00
|
|
|
9.1f > 9.2
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello > "hello" )
|
|
|
|
with expansion:
|
|
|
|
"hello" > "hello"
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello < "hello" )
|
|
|
|
with expansion:
|
|
|
|
"hello" < "hello"
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello > "hellp" )
|
|
|
|
with expansion:
|
|
|
|
"hello" > "hellp"
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello > "z" )
|
|
|
|
with expansion:
|
|
|
|
"hello" > "z"
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello < "hellm" )
|
|
|
|
with expansion:
|
|
|
|
"hello" < "hellm"
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello < "a" )
|
|
|
|
with expansion:
|
|
|
|
"hello" < "a"
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello >= "z" )
|
|
|
|
with expansion:
|
|
|
|
"hello" >= "z"
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ConditionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello <= "a" )
|
|
|
|
with expansion:
|
|
|
|
"hello" <= "a"
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
2016-11-29 12:32:16 +01:00
|
|
|
Output from all sections is reported
|
|
|
|
one
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2016-11-29 12:32:16 +01:00
|
|
|
MessageTests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
MessageTests.cpp:<line number>: FAILED:
|
|
|
|
explicitly with message:
|
|
|
|
Message from section one
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Output from all sections is reported
|
|
|
|
two
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
MessageTests.cpp:<line number>
|
|
|
|
...............................................................................
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
MessageTests.cpp:<line number>: FAILED:
|
|
|
|
explicitly with message:
|
|
|
|
Message from section two
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2017-06-06 15:07:57 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Reconstruction should be based on stringification: #914
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
DecompositionTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
DecompositionTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK( truthy(false) )
|
|
|
|
with expansion:
|
|
|
|
Hey, its truthy!
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
A string sent directly to stdout
|
|
|
|
A string sent directly to stderr
|
|
|
|
Message from section one
|
|
|
|
Message from section two
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2016-11-29 12:32:16 +01:00
|
|
|
StartsWith string matcher
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2017-02-21 15:19:09 +01:00
|
|
|
MatchersTests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-02-21 15:19:09 +01:00
|
|
|
MatchersTests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
CHECK_THAT( testStringForMatching(), StartsWith( "string" ) )
|
|
|
|
with expansion:
|
|
|
|
"this string contains 'abc' as a substring" starts with: "string"
|
2013-09-27 20:01:14 +02:00
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
2016-11-29 12:32:16 +01:00
|
|
|
Tabs and newlines show in output
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2016-11-29 12:32:16 +01:00
|
|
|
MiscTests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
MiscTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK( s1 == s2 )
|
|
|
|
with expansion:
|
|
|
|
"if ($b == 10) {
|
2017-01-17 18:13:23 +01:00
|
|
|
$a = 20;
|
2016-11-29 12:32:16 +01:00
|
|
|
}"
|
|
|
|
==
|
|
|
|
"if ($b == 10) {
|
2017-01-17 18:13:23 +01:00
|
|
|
$a = 20;
|
2016-11-29 12:32:16 +01:00
|
|
|
}
|
|
|
|
"
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2017-04-09 21:40:01 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Unexpected exceptions can be translated
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
ExceptionTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
ExceptionTests.cpp:<line number>: FAILED:
|
|
|
|
due to unexpected exception with message:
|
|
|
|
3.14
|
|
|
|
|
2017-02-21 17:05:04 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Vector matchers that fail
|
|
|
|
Contains (element)
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
MatchersTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
MatchersTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK_THAT( v, VectorContains( -1 ) )
|
|
|
|
with expansion:
|
|
|
|
{ 1, 2, 3 } Contains: -1
|
|
|
|
|
|
|
|
MatchersTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK_THAT( empty, VectorContains( 1 ) )
|
|
|
|
with expansion:
|
|
|
|
{ } Contains: 1
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Vector matchers that fail
|
|
|
|
Contains (vector)
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
MatchersTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
MatchersTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK_THAT( empty, Contains( v) )
|
|
|
|
with expansion:
|
|
|
|
{ } Contains: { 1, 2, 3 }
|
|
|
|
|
|
|
|
MatchersTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK_THAT( v, Contains( v2 ) )
|
|
|
|
with expansion:
|
|
|
|
{ 1, 2, 3 } Contains: { 1, 2, 4 }
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Vector matchers that fail
|
|
|
|
Equals
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
MatchersTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
MatchersTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK_THAT( v, Equals( v2 ) )
|
|
|
|
with expansion:
|
|
|
|
{ 1, 2, 3 } Equals: { 1, 2 }
|
|
|
|
|
|
|
|
MatchersTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK_THAT( v2, Equals( v ) )
|
|
|
|
with expansion:
|
|
|
|
{ 1, 2 } Equals: { 1, 2, 3 }
|
|
|
|
|
|
|
|
MatchersTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK_THAT( empty, Equals( v ) )
|
|
|
|
with expansion:
|
|
|
|
{ } Equals: { 1, 2, 3 }
|
|
|
|
|
|
|
|
MatchersTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK_THAT( v, Equals( empty ) )
|
|
|
|
with expansion:
|
|
|
|
{ 1, 2, 3 } Equals: { }
|
|
|
|
|
2017-04-09 21:40:01 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
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
|
|
|
|
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2017-01-23 18:56:41 +01:00
|
|
|
When unchecked exceptions are thrown during a CHECK the test should continue
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2013-09-30 09:01:10 +02:00
|
|
|
ExceptionTests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
ExceptionTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( thisThrows() == 0 )
|
|
|
|
due to unexpected exception with message:
|
|
|
|
expected exception
|
|
|
|
|
2014-04-12 20:07:24 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2014-04-12 20:20:46 +02:00
|
|
|
When unchecked exceptions are thrown during a REQUIRE the test should abort
|
|
|
|
fail
|
2014-04-12 20:07:24 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
ExceptionTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
ExceptionTests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( thisThrows() == 0 )
|
|
|
|
due to unexpected exception with message:
|
|
|
|
expected exception
|
|
|
|
|
2014-04-12 20:20:46 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2016-11-29 12:32:16 +01:00
|
|
|
When unchecked exceptions are thrown from functions they are always failures
|
2014-04-12 20:20:46 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
ExceptionTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
ExceptionTests.cpp:<line number>: FAILED:
|
|
|
|
CHECK( thisThrows() == 0 )
|
|
|
|
due to unexpected exception with message:
|
|
|
|
expected exception
|
|
|
|
|
2017-04-09 21:40:01 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
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
|
|
|
|
|
2015-11-18 09:39:21 +01:00
|
|
|
-------------------------------------------------------------------------------
|
2016-11-29 12:32:16 +01:00
|
|
|
Where the LHS is not a simple value
|
2015-11-18 09:39:21 +01:00
|
|
|
-------------------------------------------------------------------------------
|
2016-11-29 12:32:16 +01:00
|
|
|
TrickyTests.cpp:<line number>
|
2015-11-18 09:39:21 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
TrickyTests.cpp:<line number>:
|
|
|
|
warning:
|
|
|
|
Uncomment the code in this test to check that it gives a sensible compiler
|
|
|
|
error
|
2015-11-18 09:39:21 +01:00
|
|
|
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2016-11-29 12:32:16 +01:00
|
|
|
Where there is more to the expression after the RHS
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2016-11-29 12:32:16 +01:00
|
|
|
TrickyTests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
TrickyTests.cpp:<line number>:
|
|
|
|
warning:
|
|
|
|
Uncomment the code in this test to check that it gives a sensible compiler
|
|
|
|
error
|
2013-09-27 20:01:14 +02:00
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
2016-11-29 12:32:16 +01:00
|
|
|
checkedElse, failing
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2016-11-29 12:32:16 +01:00
|
|
|
MiscTests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
MiscTests.cpp:<line number>: FAILED:
|
|
|
|
CHECKED_ELSE( flag )
|
|
|
|
with expansion:
|
|
|
|
false
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
MiscTests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( testCheckedElse( false ) )
|
|
|
|
with expansion:
|
|
|
|
false
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2015-07-13 07:34:41 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2016-11-29 12:32:16 +01:00
|
|
|
checkedIf, failing
|
2015-07-13 07:34:41 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2016-11-29 12:32:16 +01:00
|
|
|
MiscTests.cpp:<line number>
|
2015-07-13 07:34:41 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
MiscTests.cpp:<line number>: FAILED:
|
|
|
|
CHECKED_IF( flag )
|
2015-07-13 07:34:41 +02:00
|
|
|
with expansion:
|
2016-11-29 12:32:16 +01:00
|
|
|
false
|
|
|
|
|
|
|
|
MiscTests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( testCheckedIf( false ) )
|
|
|
|
with expansion:
|
|
|
|
false
|
2015-07-13 07:34:41 +02:00
|
|
|
|
2017-08-11 11:38:29 +02:00
|
|
|
loose text artifact
|
|
|
|
-------------------------------------------------------------------------------
|
2016-11-29 12:32:16 +01:00
|
|
|
just failure
|
2013-11-13 09:07:38 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
MessageTests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
MessageTests.cpp:<line number>: FAILED:
|
|
|
|
explicitly with message:
|
|
|
|
Previous info should not be seen
|
2013-09-27 20:01:14 +02:00
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
2013-11-19 08:21:03 +01:00
|
|
|
looped SECTION tests
|
2013-09-27 20:01:14 +02:00
|
|
|
s1
|
|
|
|
-------------------------------------------------------------------------------
|
2013-09-30 09:01:10 +02:00
|
|
|
MiscTests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
MiscTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( b > a )
|
|
|
|
with expansion:
|
|
|
|
0 > 1
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
2013-11-19 08:21:03 +01:00
|
|
|
looped tests
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2013-09-30 09:01:10 +02:00
|
|
|
MiscTests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
MiscTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( ( fib[i] % 2 ) == 0 )
|
|
|
|
with expansion:
|
|
|
|
1 == 0
|
|
|
|
with message:
|
|
|
|
Testing if fib[0] (1) is even
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
MiscTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( ( fib[i] % 2 ) == 0 )
|
|
|
|
with expansion:
|
|
|
|
1 == 0
|
|
|
|
with message:
|
|
|
|
Testing if fib[1] (1) is even
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
MiscTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( ( fib[i] % 2 ) == 0 )
|
|
|
|
with expansion:
|
|
|
|
1 == 0
|
|
|
|
with message:
|
|
|
|
Testing if fib[3] (3) is even
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
MiscTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( ( fib[i] % 2 ) == 0 )
|
|
|
|
with expansion:
|
|
|
|
1 == 0
|
|
|
|
with message:
|
|
|
|
Testing if fib[4] (5) is even
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
MiscTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( ( fib[i] % 2 ) == 0 )
|
|
|
|
with expansion:
|
|
|
|
1 == 0
|
|
|
|
with message:
|
|
|
|
Testing if fib[6] (13) is even
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
MiscTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( ( fib[i] % 2 ) == 0 )
|
|
|
|
with expansion:
|
|
|
|
1 == 0
|
|
|
|
with message:
|
|
|
|
Testing if fib[7] (21) is even
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
2016-11-29 12:32:16 +01:00
|
|
|
more nested SECTION tests
|
|
|
|
s1
|
|
|
|
s2
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2013-09-30 09:01:10 +02:00
|
|
|
MiscTests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
MiscTests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
REQUIRE( a == b )
|
2013-09-27 20:01:14 +02:00
|
|
|
with expansion:
|
2016-11-29 12:32:16 +01:00
|
|
|
1 == 2
|
2013-09-27 20:01:14 +02:00
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
2013-11-19 08:21:03 +01:00
|
|
|
send a single char to INFO
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2013-09-30 09:01:10 +02:00
|
|
|
MiscTests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
MiscTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
REQUIRE( false )
|
|
|
|
with message:
|
|
|
|
3
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
2016-11-29 12:32:16 +01:00
|
|
|
sends information to INFO
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2016-11-29 12:32:16 +01:00
|
|
|
MessageTests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
MessageTests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( false )
|
|
|
|
with messages:
|
|
|
|
hi
|
|
|
|
i := 7
|
2013-09-27 20:01:14 +02:00
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
2014-12-21 01:20:09 +01:00
|
|
|
string literals of different sizes can be compared
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2013-09-30 09:01:10 +02:00
|
|
|
TrickyTests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2013-09-30 09:01:10 +02:00
|
|
|
TrickyTests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
REQUIRE( std::string( "first" ) == "second" )
|
|
|
|
with expansion:
|
|
|
|
"first" == "second"
|
|
|
|
|
2017-07-13 09:52:51 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
toString(enum class)
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
EnumToString.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
EnumToString.cpp:<line number>: FAILED:
|
|
|
|
CHECK( ::Catch::Detail::stringify(e0) == "0" )
|
|
|
|
with expansion:
|
|
|
|
"{?}" == "0"
|
|
|
|
|
|
|
|
EnumToString.cpp:<line number>: FAILED:
|
|
|
|
CHECK( ::Catch::Detail::stringify(e1) == "1" )
|
|
|
|
with expansion:
|
|
|
|
"{?}" == "1"
|
|
|
|
|
2013-09-27 20:01:14 +02:00
|
|
|
===============================================================================
|
2017-10-13 15:16:14 +02:00
|
|
|
test cases: 180 | 129 passed | 47 failed | 4 failed as expected
|
|
|
|
assertions: 886 | 769 passed | 96 failed | 21 failed as expected
|
2013-09-27 20:01:14 +02:00
|
|
|
|