2022-10-27 20:43:00 +02:00
|
|
|
Filters: "*" ~[!nonportable] ~[!benchmark] ~[approvals]
|
2022-04-19 10:32:13 +02:00
|
|
|
Randomness seeded to: 1
|
2013-09-27 20:01:14 +02:00
|
|
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2022-05-03 19:44:55 +02:00
|
|
|
<exe-name> is a Catch2 v<version> host application.
|
2013-09-27 20:01:14 +02:00
|
|
|
Run with -? for options
|
|
|
|
|
2019-04-10 20:15:42 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
#1455 - INFO and WARN can start with a linebreak
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Message.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Message.tests.cpp:<line number>: warning:
|
|
|
|
|
|
|
|
This warning message starts with a linebreak
|
|
|
|
|
|
|
|
This would not be caught previously
|
|
|
|
Nor would this
|
2019-03-02 21:22:41 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
#1514: stderr/stdout is not captured in tests aborted by an exception
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Tricky.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Tricky.tests.cpp:<line number>: FAILED:
|
|
|
|
explicitly with message:
|
|
|
|
1514
|
|
|
|
|
2023-01-17 11:04:49 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
#2615 - Throwing in constructor generator fails test case but does not abort
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Generators.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Generators.tests.cpp:<line number>: FAILED:
|
|
|
|
due to unexpected exception with message:
|
|
|
|
failure to init
|
|
|
|
|
2017-04-09 21:40:01 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
#748 - captures with unexpected exceptions
|
|
|
|
outside assertions
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>
|
2017-04-09 21:40:01 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>: FAILED:
|
2017-04-09 21:40:01 +02:00
|
|
|
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
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>
|
2017-04-07 10:33:19 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>: FAILED:
|
2017-04-07 10:33:19 +02:00
|
|
|
REQUIRE_NOTHROW( thisThrows() )
|
|
|
|
due to unexpected exception with messages:
|
|
|
|
answer := 42
|
|
|
|
expected exception
|
|
|
|
|
2017-03-06 22:07:33 +01:00
|
|
|
-------------------------------------------------------------------------------
|
2022-01-26 23:47:40 +01:00
|
|
|
#835 -- errno should not be touched by Catch2
|
2017-03-06 22:07:33 +01:00
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.cpp:<line number>
|
2017-03-06 22:07:33 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.cpp:<line number>: FAILED:
|
2017-03-06 22:07:33 +01:00
|
|
|
CHECK( f() == 0 )
|
|
|
|
with expansion:
|
|
|
|
1 == 0
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
'Not' checks that should fail
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>
|
2016-11-29 12:32:16 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
CHECK( false != false )
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
CHECK( true != true )
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
CHECK( !true )
|
|
|
|
with expansion:
|
|
|
|
false
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
CHECK_FALSE( true )
|
2017-10-13 20:45:19 +02:00
|
|
|
with expansion:
|
|
|
|
!true
|
2016-11-29 12:32:16 +01:00
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
CHECK( !trueValue )
|
|
|
|
with expansion:
|
|
|
|
false
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
CHECK_FALSE( trueValue )
|
|
|
|
with expansion:
|
|
|
|
!true
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
CHECK( !(1 == 1) )
|
|
|
|
with expansion:
|
|
|
|
false
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
CHECK_FALSE( 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
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Class.tests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Class.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
REQUIRE( s == "world" )
|
|
|
|
with expansion:
|
|
|
|
"hello" == "world"
|
|
|
|
|
Template tests: added TEMPLATE_PRODUCT_TEST_CASE
support for generating test cases based on multiple template template
types combined with template arguments for each of the template template
types specified
e.g.
```
TEMPLATE_PRODUCT_TEST_CASE("template product","[template]",
(std::tuple, std::pair, std::map),
((int,float),(char,double),(int,char)))
```
will effectively create 9 test cases with types:
std::tuple<int,float>
std::tuple<char,double>
std::tuple<int,char>
std::pair<int,float>
std::pair<char, double>
std::pair<int,char>
std::map<int,float>
std::map<char,double>
std::map<int,char>
Tested type is accessible in test case body as TestType
Unique name is created by appending ` - <index>` to test name
since preprocessor has some limitations in recursions
Closes #1454
2018-12-06 19:27:33 +01:00
|
|
|
-------------------------------------------------------------------------------
|
2019-02-17 21:52:22 +01:00
|
|
|
A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo
|
|
|
|
<float>
|
Template tests: added TEMPLATE_PRODUCT_TEST_CASE
support for generating test cases based on multiple template template
types combined with template arguments for each of the template template
types specified
e.g.
```
TEMPLATE_PRODUCT_TEST_CASE("template product","[template]",
(std::tuple, std::pair, std::map),
((int,float),(char,double),(int,char)))
```
will effectively create 9 test cases with types:
std::tuple<int,float>
std::tuple<char,double>
std::tuple<int,char>
std::pair<int,float>
std::pair<char, double>
std::pair<int,char>
std::map<int,float>
std::map<char,double>
std::map<int,char>
Tested type is accessible in test case body as TestType
Unique name is created by appending ` - <index>` to test name
since preprocessor has some limitations in recursions
Closes #1454
2018-12-06 19:27:33 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Class.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Class.tests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 )
|
|
|
|
with expansion:
|
|
|
|
0 == 1
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
2019-02-17 21:52:22 +01:00
|
|
|
A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo
|
|
|
|
<int>
|
Template tests: added TEMPLATE_PRODUCT_TEST_CASE
support for generating test cases based on multiple template template
types combined with template arguments for each of the template template
types specified
e.g.
```
TEMPLATE_PRODUCT_TEST_CASE("template product","[template]",
(std::tuple, std::pair, std::map),
((int,float),(char,double),(int,char)))
```
will effectively create 9 test cases with types:
std::tuple<int,float>
std::tuple<char,double>
std::tuple<int,char>
std::pair<int,float>
std::pair<char, double>
std::pair<int,char>
std::map<int,float>
std::map<char,double>
std::map<int,char>
Tested type is accessible in test case body as TestType
Unique name is created by appending ` - <index>` to test name
since preprocessor has some limitations in recursions
Closes #1454
2018-12-06 19:27:33 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Class.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Class.tests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 )
|
|
|
|
with expansion:
|
|
|
|
0 == 1
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
2019-02-17 21:52:22 +01:00
|
|
|
A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector
|
|
|
|
<float>
|
Template tests: added TEMPLATE_PRODUCT_TEST_CASE
support for generating test cases based on multiple template template
types combined with template arguments for each of the template template
types specified
e.g.
```
TEMPLATE_PRODUCT_TEST_CASE("template product","[template]",
(std::tuple, std::pair, std::map),
((int,float),(char,double),(int,char)))
```
will effectively create 9 test cases with types:
std::tuple<int,float>
std::tuple<char,double>
std::tuple<int,char>
std::pair<int,float>
std::pair<char, double>
std::pair<int,char>
std::map<int,float>
std::map<char,double>
std::map<int,char>
Tested type is accessible in test case body as TestType
Unique name is created by appending ` - <index>` to test name
since preprocessor has some limitations in recursions
Closes #1454
2018-12-06 19:27:33 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Class.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Class.tests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 )
|
|
|
|
with expansion:
|
|
|
|
0 == 1
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
2019-02-17 21:52:22 +01:00
|
|
|
A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector
|
|
|
|
<int>
|
Template tests: added TEMPLATE_PRODUCT_TEST_CASE
support for generating test cases based on multiple template template
types combined with template arguments for each of the template template
types specified
e.g.
```
TEMPLATE_PRODUCT_TEST_CASE("template product","[template]",
(std::tuple, std::pair, std::map),
((int,float),(char,double),(int,char)))
```
will effectively create 9 test cases with types:
std::tuple<int,float>
std::tuple<char,double>
std::tuple<int,char>
std::pair<int,float>
std::pair<char, double>
std::pair<int,char>
std::map<int,float>
std::map<char,double>
std::map<int,char>
Tested type is accessible in test case body as TestType
Unique name is created by appending ` - <index>` to test name
since preprocessor has some limitations in recursions
Closes #1454
2018-12-06 19:27:33 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Class.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Class.tests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( Template_Fixture_2<TestType>::m_a.size() == 1 )
|
|
|
|
with expansion:
|
|
|
|
0 == 1
|
|
|
|
|
2019-05-23 19:29:18 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails -
|
|
|
|
Template_Foo_2<float, 6>
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Class.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Class.tests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 )
|
|
|
|
with expansion:
|
|
|
|
6 < 2
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails -
|
|
|
|
Template_Foo_2<int, 2>
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Class.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Class.tests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 )
|
|
|
|
with expansion:
|
|
|
|
2 < 2
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array
|
|
|
|
<float, 6>
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Class.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Class.tests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 )
|
|
|
|
with expansion:
|
|
|
|
6 < 2
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array
|
|
|
|
<int, 2>
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Class.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Class.tests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( Template_Fixture_2<TestType>{}.m_a.size() < 2 )
|
|
|
|
with expansion:
|
|
|
|
2 < 2
|
|
|
|
|
2018-11-08 07:26:39 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
A TEMPLATE_TEST_CASE_METHOD based test run that fails - double
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Class.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Class.tests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( Template_Fixture<TestType>::m_a == 2 )
|
|
|
|
with expansion:
|
|
|
|
1.0 == 2
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
A TEMPLATE_TEST_CASE_METHOD based test run that fails - float
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Class.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Class.tests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( Template_Fixture<TestType>::m_a == 2 )
|
|
|
|
with expansion:
|
|
|
|
1.0f == 2
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
A TEMPLATE_TEST_CASE_METHOD based test run that fails - int
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Class.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Class.tests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( Template_Fixture<TestType>::m_a == 2 )
|
|
|
|
with expansion:
|
|
|
|
1 == 2
|
|
|
|
|
2019-05-23 19:29:18 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 1
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Class.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Class.tests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( Nttp_Fixture<V>::value == 0 )
|
|
|
|
with expansion:
|
|
|
|
1 == 0
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 3
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Class.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Class.tests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( Nttp_Fixture<V>::value == 0 )
|
|
|
|
with expansion:
|
|
|
|
3 == 0
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 6
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Class.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Class.tests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( Nttp_Fixture<V>::value == 0 )
|
|
|
|
with expansion:
|
|
|
|
6 == 0
|
|
|
|
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
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
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Class.tests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Class.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
REQUIRE( m_a == 2 )
|
|
|
|
with expansion:
|
|
|
|
1 == 2
|
|
|
|
|
2024-08-05 17:01:41 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
A TEST_CASE_PERSISTENT_FIXTURE based test run that fails
|
|
|
|
Second partial run
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Class.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Class.tests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( m_a == 0 )
|
|
|
|
with expansion:
|
|
|
|
1 == 0
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
A couple of nested sections followed by a failure
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.cpp:<line number>
|
2016-11-29 12:32:16 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
explicitly with message:
|
|
|
|
to infinity and beyond
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
A failing expression with a non streamable type is still captured
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Tricky.tests.cpp:<line number>
|
2016-11-29 12:32:16 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Tricky.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
CHECK( &o1 == &o2 )
|
|
|
|
with expansion:
|
|
|
|
0x<hex digits> == 0x<hex digits>
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Tricky.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
CHECK( o1 == o2 )
|
|
|
|
with expansion:
|
|
|
|
{?} == {?}
|
|
|
|
|
2017-04-09 21:40:01 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
An unchecked exception reports the line of the last assertion
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>
|
2017-04-09 21:40:01 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>: FAILED:
|
2017-04-09 21:40:01 +02:00
|
|
|
{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-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>
|
2016-11-29 12:32:16 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-09-23 23:28:59 +02:00
|
|
|
CHECK_THAT( testStringForMatching(), ContainsSubstring( "not there", Catch::CaseSensitive::No ) )
|
2016-11-29 12:32:16 +01:00
|
|
|
with expansion:
|
2017-11-13 15:46:33 +01:00
|
|
|
"this string contains 'abc' as a substring" contains: "not there" (case
|
|
|
|
insensitive)
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-09-23 23:28:59 +02:00
|
|
|
CHECK_THAT( testStringForMatching(), ContainsSubstring( "STRING" ) )
|
2017-11-13 15:46:33 +01:00
|
|
|
with expansion:
|
|
|
|
"this string contains 'abc' as a substring" contains: "STRING"
|
2016-11-29 12:32:16 +01:00
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Custom exceptions can be translated when testing for nothrow
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>
|
2016-11-29 12:32:16 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
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
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>
|
2016-11-29 12:32:16 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.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
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>
|
2017-04-09 21:40:01 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>: FAILED:
|
2017-04-09 21:40:01 +02:00
|
|
|
due to unexpected exception with message:
|
|
|
|
custom std exception
|
|
|
|
|
2023-05-31 15:12:23 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Empty generators can SKIP in constructor
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Skip.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Skip.tests.cpp:<line number>: SKIPPED:
|
|
|
|
explicitly with message:
|
|
|
|
This generator is empty
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
EndsWith string matcher
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>
|
2016-11-29 12:32:16 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THAT( testStringForMatching(), EndsWith( "Substring" ) )
|
2017-11-13 15:46:33 +01:00
|
|
|
with expansion:
|
|
|
|
"this string contains 'abc' as a substring" ends with: "Substring"
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THAT( testStringForMatching(), EndsWith( "this", Catch::CaseSensitive::No ) )
|
2016-11-29 12:32:16 +01:00
|
|
|
with expansion:
|
2017-11-13 15:46:33 +01:00
|
|
|
"this string contains 'abc' as a substring" ends with: "this" (case
|
|
|
|
insensitive)
|
2016-11-29 12:32:16 +01:00
|
|
|
|
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
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.int_seven == 6 )
|
|
|
|
with expansion:
|
|
|
|
7 == 6
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.int_seven == 8 )
|
|
|
|
with expansion:
|
|
|
|
7 == 8
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.int_seven == 0 )
|
|
|
|
with expansion:
|
|
|
|
7 == 0
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.float_nine_point_one == Approx( 9.11f ) )
|
|
|
|
with expansion:
|
2024-04-30 16:43:05 +02:00
|
|
|
9.100000381f
|
|
|
|
==
|
|
|
|
Approx( 9.10999965667724609 )
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.float_nine_point_one == Approx( 9.0f ) )
|
|
|
|
with expansion:
|
2024-04-30 16:43:05 +02:00
|
|
|
9.100000381f == Approx( 9.0 )
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.float_nine_point_one == Approx( 1 ) )
|
|
|
|
with expansion:
|
2024-04-30 16:43:05 +02:00
|
|
|
9.100000381f == Approx( 1.0 )
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.float_nine_point_one == Approx( 0 ) )
|
|
|
|
with expansion:
|
2024-04-30 16:43:05 +02:00
|
|
|
9.100000381f == Approx( 0.0 )
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.double_pi == Approx( 3.1415 ) )
|
|
|
|
with expansion:
|
2024-04-30 16:43:05 +02:00
|
|
|
3.14159265350000005
|
|
|
|
==
|
|
|
|
Approx( 3.14150000000000018 )
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello == "goodbye" )
|
|
|
|
with expansion:
|
|
|
|
"hello" == "goodbye"
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello == "hell" )
|
|
|
|
with expansion:
|
|
|
|
"hello" == "hell"
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello == "hello1" )
|
|
|
|
with expansion:
|
|
|
|
"hello" == "hello1"
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello.size() == 6 )
|
|
|
|
with expansion:
|
|
|
|
5 == 6
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( x == Approx( 1.301 ) )
|
|
|
|
with expansion:
|
2024-04-30 16:43:05 +02:00
|
|
|
1.30000000000000027
|
|
|
|
==
|
|
|
|
Approx( 1.30099999999999993 )
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Equals string matcher
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>
|
2016-11-29 12:32:16 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THAT( testStringForMatching(), Equals( "this string contains 'ABC' as a substring" ) )
|
2016-11-29 12:32:16 +01:00
|
|
|
with expansion:
|
2017-11-13 15:46:33 +01:00
|
|
|
"this string contains 'abc' as a substring" equals: "this string contains
|
|
|
|
'ABC' as a substring"
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THAT( testStringForMatching(), Equals( "something else", Catch::CaseSensitive::No ) )
|
2017-11-13 15:46:33 +01:00
|
|
|
with expansion:
|
|
|
|
"this string contains 'abc' as a substring" equals: "something else" (case
|
|
|
|
insensitive)
|
2016-11-29 12:32:16 +01:00
|
|
|
|
2017-06-06 15:07:57 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Exception matchers that fail
|
|
|
|
No exception
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>
|
2017-06-06 15:07:57 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +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:
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +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
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>
|
2017-06-06 15:07:57 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +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
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +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
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>
|
2017-06-06 15:07:57 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THROWS_MATCHES( throwsSpecialException( 3 ), SpecialException, ExceptionMatcher{ 1 } )
|
2017-06-06 15:07:57 +02:00
|
|
|
with expansion:
|
2018-05-12 20:37:13 +02:00
|
|
|
SpecialException::what special exception has value of 1
|
2017-06-06 15:07:57 +02:00
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
REQUIRE_THROWS_MATCHES( throwsSpecialException( 4 ), SpecialException, ExceptionMatcher{ 1 } )
|
2017-06-06 15:07:57 +02:00
|
|
|
with expansion:
|
2018-05-12 20:37:13 +02:00
|
|
|
SpecialException::what special exception has value of 1
|
2017-06-06 15:07:57 +02:00
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Expected exceptions that don't throw or unexpected exceptions fail the test
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>
|
2016-11-29 12:32:16 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.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
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.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:
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
CHECK_NOTHROW( thisThrows() )
|
|
|
|
due to unexpected exception with message:
|
|
|
|
expected exception
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
FAIL aborts the test
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Message.tests.cpp:<line number>
|
2016-11-29 12:32:16 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Message.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
explicitly with message:
|
|
|
|
This is a failure
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
FAIL does not require an argument
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Message.tests.cpp:<line number>
|
2016-11-29 12:32:16 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Message.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
|
2017-03-08 16:40:20 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
FAIL_CHECK does not abort the test
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Message.tests.cpp:<line number>
|
2017-03-08 16:40:20 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Message.tests.cpp:<line number>: FAILED:
|
2017-03-08 16:40:20 +01:00
|
|
|
explicitly with message:
|
|
|
|
This is a failure
|
|
|
|
|
2018-11-04 20:31:49 +01:00
|
|
|
Message.tests.cpp:<line number>: warning:
|
2017-03-08 16:40:20 +01:00
|
|
|
This message appears in the output
|
|
|
|
|
2023-09-17 10:44:31 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
INFO and UNSCOPED_INFO can stream multiple arguments
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Message.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Message.tests.cpp:<line number>: FAILED:
|
|
|
|
explicitly with messages:
|
|
|
|
This info has multiple parts.
|
|
|
|
This unscoped info has multiple parts.
|
|
|
|
Show infos!
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
INFO and WARN do not abort tests
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Message.tests.cpp:<line number>
|
2016-11-29 12:32:16 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2018-11-04 20:31:49 +01:00
|
|
|
Message.tests.cpp:<line number>: warning:
|
2016-11-29 12:32:16 +01:00
|
|
|
this is a warning
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
INFO gets logged on failure
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Message.tests.cpp:<line number>
|
2016-11-29 12:32:16 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Message.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
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
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Message.tests.cpp:<line number>
|
2016-11-29 12:32:16 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Message.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
CHECK( a == 1 )
|
|
|
|
with expansion:
|
|
|
|
2 == 1
|
|
|
|
with messages:
|
|
|
|
this message may be logged later
|
|
|
|
this message should be logged
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Message.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
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
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Message.tests.cpp:<line number>
|
2017-08-10 17:06:32 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Message.tests.cpp:<line number>: FAILED:
|
2017-08-10 17:06:32 +02:00
|
|
|
REQUIRE( i < 10 )
|
|
|
|
with expansion:
|
|
|
|
10 < 10
|
|
|
|
with messages:
|
|
|
|
current counter 10
|
|
|
|
i := 10
|
|
|
|
|
2023-08-07 22:07:31 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Incomplete AssertionHandler
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
AssertionHandler.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
AssertionHandler.tests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( Dummy )
|
|
|
|
due to unexpected exception with message:
|
|
|
|
Exception translation was disabled by CATCH_CONFIG_FAST_COMPILE
|
|
|
|
|
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
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.int_seven != 7 )
|
|
|
|
with expansion:
|
|
|
|
7 != 7
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.float_nine_point_one != Approx( 9.1f ) )
|
|
|
|
with expansion:
|
2024-04-30 16:43:05 +02:00
|
|
|
9.100000381f
|
|
|
|
!=
|
|
|
|
Approx( 9.10000038146972656 )
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.double_pi != Approx( 3.1415926535 ) )
|
|
|
|
with expansion:
|
2024-04-30 16:43:05 +02:00
|
|
|
3.14159265350000005
|
|
|
|
!=
|
|
|
|
Approx( 3.14159265350000005 )
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello != "hello" )
|
|
|
|
with expansion:
|
|
|
|
"hello" != "hello"
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.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-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-09-23 23:28:59 +02:00
|
|
|
CHECK_THAT( testStringForMatching(), ( ContainsSubstring( "string" ) || ContainsSubstring( "different" ) ) && ContainsSubstring( "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-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>
|
2016-11-29 12:32:16 +01:00
|
|
|
...............................................................................
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-09-23 23:28:59 +02:00
|
|
|
CHECK_THAT( testStringForMatching(), !ContainsSubstring( "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"
|
|
|
|
|
2021-06-07 19:53:34 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Mayfail test case with nested sections
|
|
|
|
A
|
|
|
|
1
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Condition.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Mayfail test case with nested sections
|
|
|
|
A
|
|
|
|
2
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Condition.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Mayfail test case with nested sections
|
|
|
|
B
|
|
|
|
1
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Condition.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Mayfail test case with nested sections
|
|
|
|
B
|
|
|
|
2
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Condition.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Mismatching exception messages failing the test
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>
|
2016-11-29 12:32:16 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
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
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.cpp:<line number>
|
2016-11-29 12:32:16 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2018-11-04 20:31:49 +01:00
|
|
|
Misc.tests.cpp:<line number>: warning:
|
2016-11-29 12:32:16 +01:00
|
|
|
This one ran
|
|
|
|
|
2017-04-09 21:40:01 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Non-std exceptions can be translated
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>
|
2017-04-09 21:40:01 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>: FAILED:
|
2017-04-09 21:40:01 +02:00
|
|
|
due to unexpected exception with message:
|
|
|
|
custom exception
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Ordering comparison checks that should fail
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>
|
2016-11-29 12:32:16 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
CHECK( data.int_seven > 7 )
|
|
|
|
with expansion:
|
|
|
|
7 > 7
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
CHECK( data.int_seven < 7 )
|
|
|
|
with expansion:
|
|
|
|
7 < 7
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
CHECK( data.int_seven > 8 )
|
|
|
|
with expansion:
|
|
|
|
7 > 8
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
CHECK( data.int_seven < 6 )
|
|
|
|
with expansion:
|
|
|
|
7 < 6
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.int_seven < 0 )
|
|
|
|
with expansion:
|
|
|
|
7 < 0
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.int_seven < -1 )
|
|
|
|
with expansion:
|
|
|
|
7 < -1
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.int_seven >= 8 )
|
|
|
|
with expansion:
|
|
|
|
7 >= 8
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.int_seven <= 6 )
|
|
|
|
with expansion:
|
|
|
|
7 <= 6
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.float_nine_point_one < 9 )
|
|
|
|
with expansion:
|
2024-04-30 16:43:05 +02:00
|
|
|
9.100000381f < 9
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.float_nine_point_one > 10 )
|
|
|
|
with expansion:
|
2024-04-30 16:43:05 +02:00
|
|
|
9.100000381f > 10
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.float_nine_point_one > 9.2 )
|
|
|
|
with expansion:
|
2024-04-30 16:43:05 +02:00
|
|
|
9.100000381f > 9.19999999999999929
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello > "hello" )
|
|
|
|
with expansion:
|
|
|
|
"hello" > "hello"
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello < "hello" )
|
|
|
|
with expansion:
|
|
|
|
"hello" < "hello"
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello > "hellp" )
|
|
|
|
with expansion:
|
|
|
|
"hello" > "hellp"
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello > "z" )
|
|
|
|
with expansion:
|
|
|
|
"hello" > "z"
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello < "hellm" )
|
|
|
|
with expansion:
|
|
|
|
"hello" < "hellm"
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello < "a" )
|
|
|
|
with expansion:
|
|
|
|
"hello" < "a"
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( data.str_hello >= "z" )
|
|
|
|
with expansion:
|
|
|
|
"hello" >= "z"
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Condition.tests.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
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Message.tests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Message.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
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
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Message.tests.cpp:<line number>
|
2016-11-29 12:32:16 +01:00
|
|
|
...............................................................................
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Message.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
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
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Decomposition.tests.cpp:<line number>
|
2017-06-06 15:07:57 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Decomposition.tests.cpp:<line number>: FAILED:
|
2017-06-06 15:07:57 +02:00
|
|
|
CHECK( truthy(false) )
|
|
|
|
with expansion:
|
|
|
|
Hey, its truthy!
|
|
|
|
|
2017-11-13 15:35:31 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Regex string matcher
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>
|
2017-11-13 15:35:31 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THAT( testStringForMatching(), Matches( "this STRING contains 'abc' as a substring" ) )
|
2017-11-13 15:35:31 +01:00
|
|
|
with expansion:
|
|
|
|
"this string contains 'abc' as a substring" matches "this STRING contains
|
|
|
|
'abc' as a substring" case sensitively
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THAT( testStringForMatching(), Matches( "contains 'abc' as a substring" ) )
|
2017-11-13 15:35:31 +01:00
|
|
|
with expansion:
|
|
|
|
"this string contains 'abc' as a substring" matches "contains 'abc' as a
|
|
|
|
substring" case sensitively
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THAT( testStringForMatching(), Matches( "this string contains 'abc' as a" ) )
|
2017-11-13 15:35:31 +01:00
|
|
|
with expansion:
|
|
|
|
"this string contains 'abc' as a substring" matches "this string contains
|
|
|
|
'abc' as a" case sensitively
|
|
|
|
|
2016-11-29 12:32:16 +01:00
|
|
|
A string sent directly to stdout
|
|
|
|
A string sent directly to stderr
|
2017-12-05 18:48:15 +01:00
|
|
|
A string sent to stderr via clog
|
2016-11-29 12:32:16 +01:00
|
|
|
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-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THAT( testStringForMatching(), StartsWith( "This String" ) )
|
2017-11-13 15:46:33 +01:00
|
|
|
with expansion:
|
|
|
|
"this string contains 'abc' as a substring" starts with: "This String"
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THAT( testStringForMatching(), StartsWith( "string", Catch::CaseSensitive::No ) )
|
2016-11-29 12:32:16 +01:00
|
|
|
with expansion:
|
2017-11-13 15:46:33 +01:00
|
|
|
"this string contains 'abc' as a substring" starts with: "string" (case
|
|
|
|
insensitive)
|
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
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
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
|
|
|
|
2021-05-10 21:42:47 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Testing checked-if 2
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Misc.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Misc.tests.cpp:<line number>: FAILED:
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Testing checked-if 3
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Misc.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Misc.tests.cpp:<line number>: FAILED:
|
|
|
|
|
2023-08-07 22:07:31 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Testing checked-if 4
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Misc.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Misc.tests.cpp:<line number>: FAILED:
|
|
|
|
{Unknown expression after the reported line}
|
|
|
|
due to unexpected exception with message:
|
|
|
|
Uncaught exception should fail!
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Testing checked-if 5
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Misc.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Misc.tests.cpp:<line number>: FAILED:
|
|
|
|
{Unknown expression after the reported line}
|
|
|
|
due to unexpected exception with message:
|
|
|
|
Uncaught exception should fail!
|
|
|
|
|
2018-02-15 19:58:49 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Thrown string literals are translated
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Exception.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Exception.tests.cpp:<line number>: FAILED:
|
|
|
|
due to unexpected exception with message:
|
|
|
|
For some reason someone is throwing a string literal!
|
|
|
|
|
2017-04-09 21:40:01 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Unexpected exceptions can be translated
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>
|
2017-04-09 21:40:01 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>: FAILED:
|
2017-04-09 21:40:01 +02:00
|
|
|
due to unexpected exception with message:
|
2024-04-30 16:43:05 +02:00
|
|
|
3.14000000000000012
|
2017-04-09 21:40:01 +02:00
|
|
|
|
2019-01-14 15:31:09 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Vector Approx matcher -- failing
|
|
|
|
Empty and non empty vectors are not approx equal
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Matchers.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THAT( empty, Approx( t1 ) )
|
2019-01-14 15:31:09 +01:00
|
|
|
with expansion:
|
|
|
|
{ } is approx: { 1.0, 2.0 }
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Vector Approx matcher -- failing
|
|
|
|
Just different vectors
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Matchers.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THAT( v1, Approx( v2 ) )
|
2019-01-14 15:31:09 +01:00
|
|
|
with expansion:
|
|
|
|
{ 2.0, 4.0, 6.0 } is approx: { 1.0, 3.0, 5.0 }
|
|
|
|
|
2017-02-21 17:05:04 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Vector matchers that fail
|
|
|
|
Contains (element)
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>
|
2017-02-21 17:05:04 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THAT( v, VectorContains( -1 ) )
|
2017-02-21 17:05:04 +01:00
|
|
|
with expansion:
|
|
|
|
{ 1, 2, 3 } Contains: -1
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THAT( empty, VectorContains( 1 ) )
|
2017-02-21 17:05:04 +01:00
|
|
|
with expansion:
|
|
|
|
{ } Contains: 1
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Vector matchers that fail
|
|
|
|
Contains (vector)
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>
|
2017-02-21 17:05:04 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THAT( empty, Contains( v ) )
|
2017-02-21 17:05:04 +01:00
|
|
|
with expansion:
|
|
|
|
{ } Contains: { 1, 2, 3 }
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THAT( v, Contains( v2 ) )
|
2017-02-21 17:05:04 +01:00
|
|
|
with expansion:
|
|
|
|
{ 1, 2, 3 } Contains: { 1, 2, 4 }
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Vector matchers that fail
|
|
|
|
Equals
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>
|
2017-02-21 17:05:04 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THAT( v, Equals( v2 ) )
|
2017-02-21 17:05:04 +01:00
|
|
|
with expansion:
|
|
|
|
{ 1, 2, 3 } Equals: { 1, 2 }
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THAT( v2, Equals( v ) )
|
2017-02-21 17:05:04 +01:00
|
|
|
with expansion:
|
|
|
|
{ 1, 2 } Equals: { 1, 2, 3 }
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THAT( empty, Equals( v ) )
|
2017-02-21 17:05:04 +01:00
|
|
|
with expansion:
|
|
|
|
{ } Equals: { 1, 2, 3 }
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THAT( v, Equals( empty ) )
|
2017-02-21 17:05:04 +01:00
|
|
|
with expansion:
|
|
|
|
{ 1, 2, 3 } Equals: { }
|
|
|
|
|
2017-12-07 17:07:25 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Vector matchers that fail
|
|
|
|
UnorderedEquals
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Matchers.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THAT( v, UnorderedEquals( empty ) )
|
2017-12-07 17:07:25 +01:00
|
|
|
with expansion:
|
|
|
|
{ 1, 2, 3 } UnorderedEquals: { }
|
|
|
|
|
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THAT( empty, UnorderedEquals( v ) )
|
2017-12-07 17:07:25 +01:00
|
|
|
with expansion:
|
|
|
|
{ } UnorderedEquals: { 1, 2, 3 }
|
|
|
|
|
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THAT( permuted, UnorderedEquals( v ) )
|
2017-12-07 17:07:25 +01:00
|
|
|
with expansion:
|
|
|
|
{ 1, 3 } UnorderedEquals: { 1, 2, 3 }
|
|
|
|
|
|
|
|
Matchers.tests.cpp:<line number>: FAILED:
|
2021-06-20 16:25:57 +02:00
|
|
|
CHECK_THAT( permuted, UnorderedEquals( v ) )
|
2017-12-07 17:07:25 +01:00
|
|
|
with expansion:
|
|
|
|
{ 3, 1 } UnorderedEquals: { 1, 2, 3 }
|
|
|
|
|
2017-04-09 21:40:01 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
When unchecked exceptions are thrown directly they are always failures
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>
|
2017-04-09 21:40:01 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>: FAILED:
|
2017-04-09 21:40:01 +02:00
|
|
|
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
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.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
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>
|
2014-04-12 20:07:24 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>: FAILED:
|
2014-04-12 20:07:24 +02:00
|
|
|
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
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>
|
2014-04-12 20:20:46 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>: FAILED:
|
2014-04-12 20:20:46 +02:00
|
|
|
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
|
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>
|
2017-04-09 21:40:01 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Exception.tests.cpp:<line number>: FAILED:
|
2017-04-09 21:40:01 +02:00
|
|
|
due to unexpected exception with message:
|
|
|
|
unexpected exception
|
|
|
|
|
2023-01-12 15:01:47 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
a succeeding test can still be skipped
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Skip.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Skip.tests.cpp:<line number>: SKIPPED:
|
|
|
|
|
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
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
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
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.cpp:<line number>
|
2015-07-13 07:34:41 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
REQUIRE( testCheckedIf( false ) )
|
|
|
|
with expansion:
|
|
|
|
false
|
2015-07-13 07:34:41 +02:00
|
|
|
|
2023-01-12 15:01:47 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
dynamic skipping works with generators
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Skip.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Skip.tests.cpp:<line number>: SKIPPED:
|
|
|
|
explicitly with message:
|
|
|
|
skipping because answer = 41
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
dynamic skipping works with generators
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Skip.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Skip.tests.cpp:<line number>: SKIPPED:
|
|
|
|
explicitly with message:
|
|
|
|
skipping because answer = 43
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
failed assertions before SKIP cause test case to fail
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Skip.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Skip.tests.cpp:<line number>: FAILED:
|
|
|
|
CHECK( 3 == 4 )
|
|
|
|
|
|
|
|
Skip.tests.cpp:<line number>: SKIPPED:
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
failing for some generator values causes entire test case to fail
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Skip.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Skip.tests.cpp:<line number>: FAILED:
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
failing for some generator values causes entire test case to fail
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Skip.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Skip.tests.cpp:<line number>: SKIPPED:
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
failing for some generator values causes entire test case to fail
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Skip.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Skip.tests.cpp:<line number>: FAILED:
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
failing for some generator values causes entire test case to fail
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Skip.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Skip.tests.cpp:<line number>: SKIPPED:
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
failing in some unskipped sections causes entire test case to fail
|
|
|
|
skipped
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Skip.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Skip.tests.cpp:<line number>: SKIPPED:
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
failing in some unskipped sections causes entire test case to fail
|
|
|
|
not skipped
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Skip.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Skip.tests.cpp:<line number>: FAILED:
|
|
|
|
|
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
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Message.tests.cpp:<line number>
|
2013-11-13 09:07:38 +01:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Message.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
explicitly with message:
|
|
|
|
Previous info should not be seen
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2019-02-01 16:36:35 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
just failure after unscoped info
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Message.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Message.tests.cpp:<line number>: FAILED:
|
|
|
|
explicitly with message:
|
|
|
|
previous unscoped info SHOULD not be seen
|
|
|
|
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2013-11-19 08:21:03 +01:00
|
|
|
looped SECTION tests
|
2018-06-25 20:04:29 +02:00
|
|
|
b is currently: 0
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.cpp:<line number>: FAILED:
|
2013-09-27 20:01:14 +02:00
|
|
|
CHECK( b > a )
|
|
|
|
with expansion:
|
|
|
|
0 > 1
|
|
|
|
|
2018-06-25 20:04:29 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
looped SECTION tests
|
|
|
|
b is currently: 1
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Misc.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Misc.tests.cpp:<line number>: FAILED:
|
|
|
|
CHECK( b > a )
|
|
|
|
with expansion:
|
|
|
|
1 > 1
|
|
|
|
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2013-11-19 08:21:03 +01:00
|
|
|
looped tests
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.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
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.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
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.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
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.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
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.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
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.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
|
|
|
|
|
2019-02-01 16:36:35 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
mix info, unscoped info and warning
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Message.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Message.tests.cpp:<line number>: warning:
|
|
|
|
and warn may mix
|
|
|
|
|
|
|
|
Message.tests.cpp:<line number>: warning:
|
|
|
|
they are not cleared after warnings
|
|
|
|
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2016-11-29 12:32:16 +01:00
|
|
|
more nested SECTION tests
|
2018-06-25 20:04:29 +02:00
|
|
|
doesn't equal
|
|
|
|
equal
|
2013-09-27 20:01:14 +02:00
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.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
|
|
|
|
2023-01-12 15:01:47 +01:00
|
|
|
a!
|
|
|
|
b1!
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
nested sections can be skipped dynamically at runtime
|
|
|
|
B
|
|
|
|
B2
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Skip.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Skip.tests.cpp:<line number>: SKIPPED:
|
|
|
|
|
|
|
|
!
|
2019-02-01 16:36:35 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
not prints unscoped info from previous failures
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Message.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Message.tests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( false )
|
|
|
|
with message:
|
|
|
|
this SHOULD be seen
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
prints unscoped info on failure
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Message.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Message.tests.cpp:<line number>: FAILED:
|
|
|
|
REQUIRE( false )
|
|
|
|
with messages:
|
|
|
|
this SHOULD be seen
|
|
|
|
this SHOULD also be seen
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
prints unscoped info only for the first assertion
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Message.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Message.tests.cpp:<line number>: FAILED:
|
|
|
|
CHECK( false )
|
|
|
|
with message:
|
|
|
|
this SHOULD be seen only ONCE
|
|
|
|
|
2023-01-12 15:01:47 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
sections can be skipped dynamically at runtime
|
|
|
|
skipped
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Skip.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Skip.tests.cpp:<line number>: SKIPPED:
|
|
|
|
|
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
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Misc.tests.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
|
|
|
-------------------------------------------------------------------------------
|
2017-11-13 17:03:27 +01:00
|
|
|
Message.tests.cpp:<line number>
|
2013-09-27 20:01:14 +02:00
|
|
|
...............................................................................
|
|
|
|
|
2017-11-13 17:03:27 +01:00
|
|
|
Message.tests.cpp:<line number>: FAILED:
|
2016-11-29 12:32:16 +01:00
|
|
|
REQUIRE( false )
|
|
|
|
with messages:
|
|
|
|
hi
|
|
|
|
i := 7
|
2013-09-27 20:01:14 +02:00
|
|
|
|
2023-01-12 15:01:47 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
skipped tests can optionally provide a reason
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Skip.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Skip.tests.cpp:<line number>: SKIPPED:
|
|
|
|
explicitly with message:
|
|
|
|
skipping because answer = 43
|
|
|
|
|
2019-02-01 16:36:35 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
stacks unscoped info in loops
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Message.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Message.tests.cpp:<line number>: FAILED:
|
|
|
|
CHECK( false )
|
|
|
|
with messages:
|
|
|
|
Count 1 to 3...
|
|
|
|
1
|
|
|
|
2
|
|
|
|
3
|
|
|
|
|
|
|
|
Message.tests.cpp:<line number>: FAILED:
|
|
|
|
CHECK( false )
|
|
|
|
with messages:
|
|
|
|
Count 4 to 6...
|
|
|
|
4
|
|
|
|
5
|
|
|
|
6
|
|
|
|
|
2023-01-12 15:01:47 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
tests can be skipped dynamically at runtime
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Skip.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Skip.tests.cpp:<line number>: SKIPPED:
|
|
|
|
|
2018-02-15 19:58:49 +01:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
thrown std::strings are translated
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Exception.tests.cpp:<line number>
|
|
|
|
...............................................................................
|
|
|
|
|
|
|
|
Exception.tests.cpp:<line number>: FAILED:
|
|
|
|
due to unexpected exception with message:
|
|
|
|
Why would you throw a std::string?
|
|
|
|
|
2013-09-27 20:01:14 +02:00
|
|
|
===============================================================================
|
2024-09-05 23:06:32 +02:00
|
|
|
test cases: 419 | 327 passed | 71 failed | 7 skipped | 14 failed as expected
|
2024-10-12 17:18:59 +02:00
|
|
|
assertions: 2252 | 2087 passed | 130 failed | 35 failed as expected
|
2013-09-27 20:01:14 +02:00
|
|
|
|