mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
Big assertion capture refactoring.
- moved as much logic out of the macros as possible - moved most logic into new ResultBuilder class, which wraps ExpressionResultBuilder (may take it over next), subsumes ResultAction and also takes place of ExpressionDecomposer. This introduces many SRP violations - but all in the name of minimising macro logic!
This commit is contained in:
@@ -5683,7 +5683,7 @@ TrickyTests.cpp:<line number>
|
||||
|
||||
TrickyTests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( Catch::isTrue( true ) )
|
||||
REQUIRE( Catch::alwaysTrue() )
|
||||
with expansion:
|
||||
true
|
||||
|
||||
@@ -5696,7 +5696,7 @@ TrickyTests.cpp:<line number>
|
||||
|
||||
TrickyTests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( Catch::isTrue( true ) )
|
||||
REQUIRE( Catch::alwaysTrue() )
|
||||
with expansion:
|
||||
true
|
||||
|
||||
@@ -5710,7 +5710,7 @@ TrickyTests.cpp:<line number>
|
||||
|
||||
TrickyTests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( Catch::isTrue( true ) )
|
||||
REQUIRE( Catch::alwaysTrue() )
|
||||
with expansion:
|
||||
true
|
||||
|
||||
@@ -5722,7 +5722,7 @@ TrickyTests.cpp:<line number>
|
||||
|
||||
TrickyTests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( Catch::isTrue( true ) )
|
||||
REQUIRE( Catch::alwaysTrue() )
|
||||
with expansion:
|
||||
true
|
||||
|
||||
@@ -5735,7 +5735,7 @@ TrickyTests.cpp:<line number>
|
||||
|
||||
TrickyTests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( Catch::isTrue( true ) )
|
||||
REQUIRE( Catch::alwaysTrue() )
|
||||
with expansion:
|
||||
true
|
||||
|
||||
@@ -5749,7 +5749,7 @@ TrickyTests.cpp:<line number>
|
||||
|
||||
TrickyTests.cpp:<line number>:
|
||||
PASSED:
|
||||
REQUIRE( Catch::isTrue( true ) )
|
||||
REQUIRE( Catch::alwaysTrue() )
|
||||
with expansion:
|
||||
true
|
||||
|
||||
|
@@ -5849,7 +5849,7 @@ there"
|
||||
<TestCase name="Assertions then sections">
|
||||
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TrickyTests.cpp" >
|
||||
<Original>
|
||||
Catch::isTrue( true )
|
||||
Catch::alwaysTrue()
|
||||
</Original>
|
||||
<Expanded>
|
||||
true
|
||||
@@ -5858,7 +5858,7 @@ there"
|
||||
<Section name="A section">
|
||||
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TrickyTests.cpp" >
|
||||
<Original>
|
||||
Catch::isTrue( true )
|
||||
Catch::alwaysTrue()
|
||||
</Original>
|
||||
<Expanded>
|
||||
true
|
||||
@@ -5867,7 +5867,7 @@ there"
|
||||
<Section name="Another section">
|
||||
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TrickyTests.cpp" >
|
||||
<Original>
|
||||
Catch::isTrue( true )
|
||||
Catch::alwaysTrue()
|
||||
</Original>
|
||||
<Expanded>
|
||||
true
|
||||
@@ -5879,7 +5879,7 @@ there"
|
||||
</Section>
|
||||
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TrickyTests.cpp" >
|
||||
<Original>
|
||||
Catch::isTrue( true )
|
||||
Catch::alwaysTrue()
|
||||
</Original>
|
||||
<Expanded>
|
||||
true
|
||||
@@ -5888,7 +5888,7 @@ there"
|
||||
<Section name="A section">
|
||||
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TrickyTests.cpp" >
|
||||
<Original>
|
||||
Catch::isTrue( true )
|
||||
Catch::alwaysTrue()
|
||||
</Original>
|
||||
<Expanded>
|
||||
true
|
||||
@@ -5897,7 +5897,7 @@ there"
|
||||
<Section name="Another other section">
|
||||
<Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TrickyTests.cpp" >
|
||||
<Original>
|
||||
Catch::isTrue( true )
|
||||
Catch::alwaysTrue()
|
||||
</Original>
|
||||
<Expanded>
|
||||
true
|
||||
|
@@ -22,42 +22,42 @@ TEST_CASE( "Parse test names and tags", "" ) {
|
||||
Catch::TestCase tcC = fakeTestCase( "longer name with spaces", "[two][three][.][x]" );
|
||||
Catch::TestCase tcD = fakeTestCase( "zlonger name with spacesz", "" );
|
||||
|
||||
SECTION( "Empty test spec should have no filters" ) {
|
||||
SECTION( "Empty test spec should have no filters", "" ) {
|
||||
TestSpec spec;
|
||||
CHECK( spec.hasFilters() == false );
|
||||
CHECK( spec.matches( tcA ) == false );
|
||||
CHECK( spec.matches( tcB ) == false );
|
||||
}
|
||||
|
||||
SECTION( "Test spec from empty string should have no filters" ) {
|
||||
SECTION( "Test spec from empty string should have no filters", "" ) {
|
||||
TestSpec spec = parseTestSpec( "" );
|
||||
CHECK( spec.hasFilters() == false );
|
||||
CHECK( spec.matches(tcA ) == false );
|
||||
CHECK( spec.matches( tcB ) == false );
|
||||
}
|
||||
|
||||
SECTION( "Test spec from just a comma should have no filters" ) {
|
||||
SECTION( "Test spec from just a comma should have no filters", "" ) {
|
||||
TestSpec spec = parseTestSpec( "," );
|
||||
CHECK( spec.hasFilters() == false );
|
||||
CHECK( spec.matches( tcA ) == false );
|
||||
CHECK( spec.matches( tcB ) == false );
|
||||
}
|
||||
|
||||
SECTION( "Test spec from name should have one filter" ) {
|
||||
SECTION( "Test spec from name should have one filter", "" ) {
|
||||
TestSpec spec = parseTestSpec( "b" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == false );
|
||||
CHECK( spec.matches( tcB ) == true );
|
||||
}
|
||||
|
||||
SECTION( "Test spec from quoted name should have one filter" ) {
|
||||
SECTION( "Test spec from quoted name should have one filter", "" ) {
|
||||
TestSpec spec = parseTestSpec( "\"b\"" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == false );
|
||||
CHECK( spec.matches( tcB ) == true );
|
||||
}
|
||||
|
||||
SECTION( "Test spec from name should have one filter" ) {
|
||||
SECTION( "Test spec from name should have one filter", "" ) {
|
||||
TestSpec spec = parseTestSpec( "b" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == false );
|
||||
@@ -65,7 +65,7 @@ TEST_CASE( "Parse test names and tags", "" ) {
|
||||
CHECK( spec.matches( tcC ) == false );
|
||||
}
|
||||
|
||||
SECTION( "Wildcard at the start" ) {
|
||||
SECTION( "Wildcard at the start", "" ) {
|
||||
TestSpec spec = parseTestSpec( "*spaces" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == false );
|
||||
@@ -74,7 +74,7 @@ TEST_CASE( "Parse test names and tags", "" ) {
|
||||
CHECK( spec.matches( tcD ) == false );
|
||||
CHECK( parseTestSpec( "*a" ).matches( tcA ) == true );
|
||||
}
|
||||
SECTION( "Wildcard at the end" ) {
|
||||
SECTION( "Wildcard at the end", "" ) {
|
||||
TestSpec spec = parseTestSpec( "long*" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == false );
|
||||
@@ -83,7 +83,7 @@ TEST_CASE( "Parse test names and tags", "" ) {
|
||||
CHECK( spec.matches( tcD ) == false );
|
||||
CHECK( parseTestSpec( "a*" ).matches( tcA ) == true );
|
||||
}
|
||||
SECTION( "Wildcard at both ends" ) {
|
||||
SECTION( "Wildcard at both ends", "" ) {
|
||||
TestSpec spec = parseTestSpec( "*name*" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == false );
|
||||
@@ -92,25 +92,25 @@ TEST_CASE( "Parse test names and tags", "" ) {
|
||||
CHECK( spec.matches( tcD ) == true );
|
||||
CHECK( parseTestSpec( "*a*" ).matches( tcA ) == true );
|
||||
}
|
||||
SECTION( "Redundant wildcard at the start" ) {
|
||||
SECTION( "Redundant wildcard at the start", "" ) {
|
||||
TestSpec spec = parseTestSpec( "*a" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == true );
|
||||
CHECK( spec.matches( tcB ) == false );
|
||||
}
|
||||
SECTION( "Redundant wildcard at the end" ) {
|
||||
SECTION( "Redundant wildcard at the end", "" ) {
|
||||
TestSpec spec = parseTestSpec( "a*" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == true );
|
||||
CHECK( spec.matches( tcB ) == false );
|
||||
}
|
||||
SECTION( "Redundant wildcard at both ends" ) {
|
||||
SECTION( "Redundant wildcard at both ends", "" ) {
|
||||
TestSpec spec = parseTestSpec( "*a*" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == true );
|
||||
CHECK( spec.matches( tcB ) == false );
|
||||
}
|
||||
SECTION( "Wildcard at both ends, redundant at start" ) {
|
||||
SECTION( "Wildcard at both ends, redundant at start", "" ) {
|
||||
TestSpec spec = parseTestSpec( "*longer*" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == false );
|
||||
@@ -118,7 +118,7 @@ TEST_CASE( "Parse test names and tags", "" ) {
|
||||
CHECK( spec.matches( tcC ) == true );
|
||||
CHECK( spec.matches( tcD ) == true );
|
||||
}
|
||||
SECTION( "Just wildcard" ) {
|
||||
SECTION( "Just wildcard", "" ) {
|
||||
TestSpec spec = parseTestSpec( "*" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == true );
|
||||
@@ -127,35 +127,35 @@ TEST_CASE( "Parse test names and tags", "" ) {
|
||||
CHECK( spec.matches( tcD ) == true );
|
||||
}
|
||||
|
||||
SECTION( "Single tag" ) {
|
||||
SECTION( "Single tag", "" ) {
|
||||
TestSpec spec = parseTestSpec( "[one]" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == false );
|
||||
CHECK( spec.matches( tcB ) == true );
|
||||
CHECK( spec.matches( tcC ) == false );
|
||||
}
|
||||
SECTION( "Single tag, two matches" ) {
|
||||
SECTION( "Single tag, two matches", "" ) {
|
||||
TestSpec spec = parseTestSpec( "[x]" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == false );
|
||||
CHECK( spec.matches( tcB ) == true );
|
||||
CHECK( spec.matches( tcC ) == true );
|
||||
}
|
||||
SECTION( "Two tags" ) {
|
||||
SECTION( "Two tags", "" ) {
|
||||
TestSpec spec = parseTestSpec( "[two][x]" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == false );
|
||||
CHECK( spec.matches( tcB ) == false );
|
||||
CHECK( spec.matches( tcC ) == true );
|
||||
}
|
||||
SECTION( "Two tags, spare separated" ) {
|
||||
SECTION( "Two tags, spare separated", "" ) {
|
||||
TestSpec spec = parseTestSpec( "[two] [x]" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == false );
|
||||
CHECK( spec.matches( tcB ) == false );
|
||||
CHECK( spec.matches( tcC ) == true );
|
||||
}
|
||||
SECTION( "Wildcarded name and tag" ) {
|
||||
SECTION( "Wildcarded name and tag", "" ) {
|
||||
TestSpec spec = parseTestSpec( "*name*[x]" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == false );
|
||||
@@ -163,21 +163,21 @@ TEST_CASE( "Parse test names and tags", "" ) {
|
||||
CHECK( spec.matches( tcC ) == true );
|
||||
CHECK( spec.matches( tcD ) == false );
|
||||
}
|
||||
SECTION( "Single tag exclusion" ) {
|
||||
SECTION( "Single tag exclusion", "" ) {
|
||||
TestSpec spec = parseTestSpec( "~[one]" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == true );
|
||||
CHECK( spec.matches( tcB ) == false );
|
||||
CHECK( spec.matches( tcC ) == true );
|
||||
}
|
||||
SECTION( "One tag exclusion and one tag inclusion" ) {
|
||||
SECTION( "One tag exclusion and one tag inclusion", "" ) {
|
||||
TestSpec spec = parseTestSpec( "~[two][x]" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == false );
|
||||
CHECK( spec.matches( tcB ) == true );
|
||||
CHECK( spec.matches( tcC ) == false );
|
||||
}
|
||||
SECTION( "One tag exclusion and one wldcarded name inclusion" ) {
|
||||
SECTION( "One tag exclusion and one wldcarded name inclusion", "" ) {
|
||||
TestSpec spec = parseTestSpec( "~[two]*name*" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == false );
|
||||
@@ -185,7 +185,7 @@ TEST_CASE( "Parse test names and tags", "" ) {
|
||||
CHECK( spec.matches( tcC ) == false );
|
||||
CHECK( spec.matches( tcD ) == true );
|
||||
}
|
||||
SECTION( "One tag exclusion, using exclude:, and one wldcarded name inclusion" ) {
|
||||
SECTION( "One tag exclusion, using exclude:, and one wldcarded name inclusion", "" ) {
|
||||
TestSpec spec = parseTestSpec( "exclude:[two]*name*" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == false );
|
||||
@@ -193,7 +193,7 @@ TEST_CASE( "Parse test names and tags", "" ) {
|
||||
CHECK( spec.matches( tcC ) == false );
|
||||
CHECK( spec.matches( tcD ) == true );
|
||||
}
|
||||
SECTION( "name exclusion" ) {
|
||||
SECTION( "name exclusion", "" ) {
|
||||
TestSpec spec = parseTestSpec( "~b" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == true );
|
||||
@@ -201,7 +201,7 @@ TEST_CASE( "Parse test names and tags", "" ) {
|
||||
CHECK( spec.matches( tcC ) == true );
|
||||
CHECK( spec.matches( tcD ) == true );
|
||||
}
|
||||
SECTION( "wildcarded name exclusion" ) {
|
||||
SECTION( "wildcarded name exclusion", "" ) {
|
||||
TestSpec spec = parseTestSpec( "~*name*" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == true );
|
||||
@@ -209,7 +209,7 @@ TEST_CASE( "Parse test names and tags", "" ) {
|
||||
CHECK( spec.matches( tcC ) == false );
|
||||
CHECK( spec.matches( tcD ) == false );
|
||||
}
|
||||
SECTION( "wildcarded name exclusion with tag inclusion" ) {
|
||||
SECTION( "wildcarded name exclusion with tag inclusion", "" ) {
|
||||
TestSpec spec = parseTestSpec( "~*name*,[three]" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == true );
|
||||
@@ -217,7 +217,7 @@ TEST_CASE( "Parse test names and tags", "" ) {
|
||||
CHECK( spec.matches( tcC ) == true );
|
||||
CHECK( spec.matches( tcD ) == false );
|
||||
}
|
||||
SECTION( "wildcarded name exclusion, using exclude:, with tag inclusion" ) {
|
||||
SECTION( "wildcarded name exclusion, using exclude:, with tag inclusion", "" ) {
|
||||
TestSpec spec = parseTestSpec( "exclude:*name*,[three]" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == true );
|
||||
@@ -225,7 +225,7 @@ TEST_CASE( "Parse test names and tags", "" ) {
|
||||
CHECK( spec.matches( tcC ) == true );
|
||||
CHECK( spec.matches( tcD ) == false );
|
||||
}
|
||||
SECTION( "two wildcarded names" ) {
|
||||
SECTION( "two wildcarded names", "" ) {
|
||||
TestSpec spec = parseTestSpec( "\"longer*\"\"*spaces\"" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == false );
|
||||
@@ -233,7 +233,7 @@ TEST_CASE( "Parse test names and tags", "" ) {
|
||||
CHECK( spec.matches( tcC ) == true );
|
||||
CHECK( spec.matches( tcD ) == false );
|
||||
}
|
||||
SECTION( "empty tag" ) {
|
||||
SECTION( "empty tag", "" ) {
|
||||
TestSpec spec = parseTestSpec( "[]" );
|
||||
CHECK( spec.hasFilters() == false );
|
||||
CHECK( spec.matches( tcA ) == false );
|
||||
@@ -241,7 +241,7 @@ TEST_CASE( "Parse test names and tags", "" ) {
|
||||
CHECK( spec.matches( tcC ) == false );
|
||||
CHECK( spec.matches( tcD ) == false );
|
||||
}
|
||||
SECTION( "empty quoted name" ) {
|
||||
SECTION( "empty quoted name", "" ) {
|
||||
TestSpec spec = parseTestSpec( "\"\"" );
|
||||
CHECK( spec.hasFilters() == false );
|
||||
CHECK( spec.matches( tcA ) == false );
|
||||
@@ -249,7 +249,7 @@ TEST_CASE( "Parse test names and tags", "" ) {
|
||||
CHECK( spec.matches( tcC ) == false );
|
||||
CHECK( spec.matches( tcD ) == false );
|
||||
}
|
||||
SECTION( "quoted string followed by tag exclusion" ) {
|
||||
SECTION( "quoted string followed by tag exclusion", "" ) {
|
||||
TestSpec spec = parseTestSpec( "\"*name*\"~[.]" );
|
||||
CHECK( spec.hasFilters() == true );
|
||||
CHECK( spec.matches( tcA ) == false );
|
||||
|
@@ -15,7 +15,7 @@ namespace
|
||||
{
|
||||
inline int thisThrows()
|
||||
{
|
||||
if( Catch::isTrue( true ) )
|
||||
if( Catch::alwaysTrue() )
|
||||
throw std::domain_error( "expected exception" );
|
||||
return 1;
|
||||
}
|
||||
@@ -42,14 +42,14 @@ TEST_CASE( "Expected exceptions that don't throw or unexpected exceptions fail t
|
||||
|
||||
TEST_CASE( "When unchecked exceptions are thrown directly they are always failures", "[.][failing]" )
|
||||
{
|
||||
if( Catch::isTrue( true ) )
|
||||
if( Catch::alwaysTrue() )
|
||||
throw std::domain_error( "unexpected exception" );
|
||||
}
|
||||
|
||||
TEST_CASE( "An unchecked exception reports the line of the last assertion", "[.][failing]" )
|
||||
{
|
||||
CHECK( 1 == 1 );
|
||||
if( Catch::isTrue( true ) )
|
||||
if( Catch::alwaysTrue() )
|
||||
throw std::domain_error( "unexpected exception" );
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ TEST_CASE( "When unchecked exceptions are thrown from sections they are always f
|
||||
{
|
||||
SECTION( "section name", "" )
|
||||
{
|
||||
if( Catch::isTrue( true ) )
|
||||
if( Catch::alwaysTrue() )
|
||||
throw std::domain_error( "unexpected exception" );
|
||||
}
|
||||
}
|
||||
@@ -118,12 +118,12 @@ CATCH_TRANSLATE_EXCEPTION( double& ex )
|
||||
|
||||
TEST_CASE("Unexpected custom exceptions can be translated", "[.][failing]" )
|
||||
{
|
||||
if( Catch::isTrue( true ) )
|
||||
if( Catch::alwaysTrue() )
|
||||
throw CustomException( "custom exception" );
|
||||
}
|
||||
|
||||
inline void throwCustom() {
|
||||
if( Catch::isTrue( true ) )
|
||||
if( Catch::alwaysTrue() )
|
||||
throw CustomException( "custom exception - not std" );
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ TEST_CASE( "Custom exceptions can be translated when testing for throwing as som
|
||||
|
||||
TEST_CASE( "Unexpected exceptions can be translated", "[.][failing]" )
|
||||
{
|
||||
if( Catch::isTrue( true ) )
|
||||
if( Catch::alwaysTrue() )
|
||||
throw double( 3.14 );
|
||||
}
|
||||
|
||||
|
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "catch.hpp"
|
||||
#include <iostream>
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
|
||||
|
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "catch.hpp"
|
||||
|
||||
TEST_CASE( "section tracking" ) {
|
||||
TEST_CASE( "section tracking", "" ) {
|
||||
|
||||
using namespace Catch;
|
||||
TestCaseTracker testCaseTracker( "test case" );
|
||||
@@ -24,7 +24,7 @@ TEST_CASE( "section tracking" ) {
|
||||
|
||||
CHECK_FALSE( testCaseTracker.isCompleted() );
|
||||
|
||||
SECTION( "test case with no sections" ) {
|
||||
SECTION( "test case with no sections", "" ) {
|
||||
|
||||
{
|
||||
TestCaseTracker::Guard guard( testCaseTracker );
|
||||
@@ -33,7 +33,7 @@ TEST_CASE( "section tracking" ) {
|
||||
CHECK( testCaseTracker.isCompleted() );
|
||||
}
|
||||
|
||||
SECTION( "test case with one section" ) {
|
||||
SECTION( "test case with one section", "" ) {
|
||||
|
||||
{
|
||||
TestCaseTracker::Guard guard( testCaseTracker );
|
||||
@@ -58,7 +58,7 @@ TEST_CASE( "section tracking" ) {
|
||||
}
|
||||
}
|
||||
|
||||
SECTION( "test case with two consecutive sections" ) {
|
||||
SECTION( "test case with two consecutive sections", "" ) {
|
||||
|
||||
// Enter test case
|
||||
{
|
||||
@@ -93,7 +93,7 @@ TEST_CASE( "section tracking" ) {
|
||||
CHECK( testCaseTracker.isCompleted() );
|
||||
}
|
||||
|
||||
SECTION( "test case with one section within another" ) {
|
||||
SECTION( "test case with one section within another", "" ) {
|
||||
|
||||
// Enter test case again
|
||||
{
|
||||
|
@@ -318,19 +318,19 @@ TEST_CASE( "Assertions then sections", "[Tricky]" )
|
||||
// This was causing a failure due to the way the console reporter was handling
|
||||
// the current section
|
||||
|
||||
REQUIRE( Catch::isTrue( true ) );
|
||||
REQUIRE( Catch::alwaysTrue() );
|
||||
|
||||
SECTION( "A section", "" )
|
||||
{
|
||||
REQUIRE( Catch::isTrue( true ) );
|
||||
REQUIRE( Catch::alwaysTrue() );
|
||||
|
||||
SECTION( "Another section", "" )
|
||||
{
|
||||
REQUIRE( Catch::isTrue( true ) );
|
||||
REQUIRE( Catch::alwaysTrue() );
|
||||
}
|
||||
SECTION( "Another other section", "" )
|
||||
{
|
||||
REQUIRE( Catch::isTrue( true ) );
|
||||
REQUIRE( Catch::alwaysTrue() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user