Sections are, once again, eagerly entered.

When the section tracking code was rewritten a while back to simplify and iron out some bugs the order of evaluation was changed so that each new section was skipped on the first run through.
This had unwelcome consequences for some people.
This commit restores the original semantics (while maintaining the simpler, less buggy, new code).
This commit is contained in:
Phil Nash
2014-04-21 19:02:38 +01:00
parent d7e1790347
commit a020865990
10 changed files with 107 additions and 917 deletions

View File

@@ -2848,25 +2848,6 @@ nested SECTION tests
MiscTests.cpp:<line number>
...............................................................................
MiscTests.cpp:<line number>:
PASSED:
REQUIRE( a != b )
with expansion:
1 != 2
MiscTests.cpp:<line number>:
PASSED:
REQUIRE( b != a )
with expansion:
2 != 1
-------------------------------------------------------------------------------
nested SECTION tests
s1
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
MiscTests.cpp:<line number>:
PASSED:
REQUIRE( a != b )
@@ -2906,34 +2887,6 @@ MiscTests.cpp:<line number>: FAILED:
with expansion:
1 == 2
-------------------------------------------------------------------------------
more nested SECTION tests
s1
s3
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
MiscTests.cpp:<line number>:
PASSED:
REQUIRE( a != b )
with expansion:
1 != 2
-------------------------------------------------------------------------------
more nested SECTION tests
s1
s4
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
MiscTests.cpp:<line number>:
PASSED:
REQUIRE( a < b )
with expansion:
1 < 2
-------------------------------------------------------------------------------
even more nested SECTION tests
c
@@ -3396,24 +3349,6 @@ vectors can be sized and resized
MiscTests.cpp:<line number>
...............................................................................
MiscTests.cpp:<line number>:
PASSED:
REQUIRE( v.size() == 5 )
with expansion:
5 == 5
MiscTests.cpp:<line number>:
PASSED:
REQUIRE( v.capacity() >= 5 )
with expansion:
5 >= 5
-------------------------------------------------------------------------------
vectors can be sized and resized
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
MiscTests.cpp:<line number>:
PASSED:
REQUIRE( v.size() == 5 )
@@ -3470,43 +3405,6 @@ vectors can be sized and resized
MiscTests.cpp:<line number>
...............................................................................
MiscTests.cpp:<line number>:
PASSED:
REQUIRE( v.size() == 0 )
with expansion:
0 == 0
MiscTests.cpp:<line number>:
PASSED:
REQUIRE( v.capacity() >= 5 )
with expansion:
5 >= 5
-------------------------------------------------------------------------------
vectors can be sized and resized
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
MiscTests.cpp:<line number>:
PASSED:
REQUIRE( v.size() == 5 )
with expansion:
5 == 5
MiscTests.cpp:<line number>:
PASSED:
REQUIRE( v.capacity() >= 5 )
with expansion:
5 >= 5
-------------------------------------------------------------------------------
vectors can be sized and resized
resizing smaller changes size but not capacity
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
MiscTests.cpp:<line number>:
PASSED:
REQUIRE( v.size() == 0 )
@@ -3607,26 +3505,6 @@ PASSED:
with expansion:
5 >= 5
-------------------------------------------------------------------------------
A couple of nested sections followed by a failure
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
MiscTests.cpp:<line number>: FAILED:
explicitly with message:
to infinity and beyond
-------------------------------------------------------------------------------
A couple of nested sections followed by a failure
-------------------------------------------------------------------------------
MiscTests.cpp:<line number>
...............................................................................
MiscTests.cpp:<line number>: FAILED:
explicitly with message:
to infinity and beyond
-------------------------------------------------------------------------------
A couple of nested sections followed by a failure
Outer
@@ -6261,43 +6139,6 @@ Assertions then sections
TrickyTests.cpp:<line number>
...............................................................................
TrickyTests.cpp:<line number>:
PASSED:
REQUIRE( Catch::isTrue( true ) )
with expansion:
true
-------------------------------------------------------------------------------
Assertions then sections
-------------------------------------------------------------------------------
TrickyTests.cpp:<line number>
...............................................................................
TrickyTests.cpp:<line number>:
PASSED:
REQUIRE( Catch::isTrue( true ) )
with expansion:
true
-------------------------------------------------------------------------------
Assertions then sections
A section
-------------------------------------------------------------------------------
TrickyTests.cpp:<line number>
...............................................................................
TrickyTests.cpp:<line number>:
PASSED:
REQUIRE( Catch::isTrue( true ) )
with expansion:
true
-------------------------------------------------------------------------------
Assertions then sections
-------------------------------------------------------------------------------
TrickyTests.cpp:<line number>
...............................................................................
TrickyTests.cpp:<line number>:
PASSED:
REQUIRE( Catch::isTrue( true ) )
@@ -6505,21 +6346,6 @@ Scenario: Do that thing with the thing
BDDTests.cpp:<line number>
...............................................................................
BDDTests.cpp:<line number>:
PASSED:
REQUIRE( itDoesThis() )
with expansion:
true
-------------------------------------------------------------------------------
Scenario: Do that thing with the thing
Given: This stuff exists
When: I do this
Then: it should do this
-------------------------------------------------------------------------------
BDDTests.cpp:<line number>
...............................................................................
BDDTests.cpp:<line number>:
PASSED:
REQUIRE( itDoesThis() )
@@ -6549,100 +6375,6 @@ Scenario: Vector resizing affects size and capacity
BDDTests.cpp:<line number>
...............................................................................
BDDTests.cpp:<line number>:
PASSED:
REQUIRE( v.size() == 0 )
with expansion:
0 == 0
-------------------------------------------------------------------------------
Scenario: Vector resizing affects size and capacity
Given: an empty vector
-------------------------------------------------------------------------------
BDDTests.cpp:<line number>
...............................................................................
BDDTests.cpp:<line number>:
PASSED:
REQUIRE( v.size() == 0 )
with expansion:
0 == 0
-------------------------------------------------------------------------------
Scenario: Vector resizing affects size and capacity
Given: an empty vector
-------------------------------------------------------------------------------
BDDTests.cpp:<line number>
...............................................................................
BDDTests.cpp:<line number>:
PASSED:
REQUIRE( v.size() == 0 )
with expansion:
0 == 0
-------------------------------------------------------------------------------
Scenario: Vector resizing affects size and capacity
Given: an empty vector
When: it is made larger
Then: the size and capacity go up
-------------------------------------------------------------------------------
BDDTests.cpp:<line number>
...............................................................................
BDDTests.cpp:<line number>:
PASSED:
REQUIRE( v.size() == 10 )
with expansion:
10 == 10
BDDTests.cpp:<line number>:
PASSED:
REQUIRE( v.capacity() >= 10 )
with expansion:
10 >= 10
-------------------------------------------------------------------------------
Scenario: Vector resizing affects size and capacity
Given: an empty vector
-------------------------------------------------------------------------------
BDDTests.cpp:<line number>
...............................................................................
BDDTests.cpp:<line number>:
PASSED:
REQUIRE( v.size() == 0 )
with expansion:
0 == 0
-------------------------------------------------------------------------------
Scenario: Vector resizing affects size and capacity
Given: an empty vector
When: it is made larger
Then: the size and capacity go up
-------------------------------------------------------------------------------
BDDTests.cpp:<line number>
...............................................................................
BDDTests.cpp:<line number>:
PASSED:
REQUIRE( v.size() == 10 )
with expansion:
10 == 10
BDDTests.cpp:<line number>:
PASSED:
REQUIRE( v.capacity() >= 10 )
with expansion:
10 >= 10
-------------------------------------------------------------------------------
Scenario: Vector resizing affects size and capacity
Given: an empty vector
-------------------------------------------------------------------------------
BDDTests.cpp:<line number>
...............................................................................
BDDTests.cpp:<line number>:
PASSED:
REQUIRE( v.size() == 0 )
@@ -6700,19 +6432,6 @@ Scenario: Vector resizing affects size and capacity
BDDTests.cpp:<line number>
...............................................................................
BDDTests.cpp:<line number>:
PASSED:
REQUIRE( v.size() == 0 )
with expansion:
0 == 0
-------------------------------------------------------------------------------
Scenario: Vector resizing affects size and capacity
Given: an empty vector
-------------------------------------------------------------------------------
BDDTests.cpp:<line number>
...............................................................................
BDDTests.cpp:<line number>:
PASSED:
REQUIRE( v.size() == 0 )
@@ -6764,18 +6483,6 @@ section tracking
SectionTrackerTests.cpp:<line number>
...............................................................................
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.isCompleted() )
with expansion:
!false
-------------------------------------------------------------------------------
section tracking
-------------------------------------------------------------------------------
SectionTrackerTests.cpp:<line number>
...............................................................................
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.isCompleted() )
@@ -6820,36 +6527,30 @@ section tracking
SectionTrackerTests.cpp:<line number>
...............................................................................
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.enterSection( section1Name ) )
with expansion:
!false
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.isCompleted() )
with expansion:
!false
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.isCompleted() )
with expansion:
!false
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK( testCaseTracker.enterSection( section1Name ) )
with expansion:
true
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.isCompleted() )
with expansion:
!false
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK( testCaseTracker.isCompleted() )
with expansion:
true
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.enterSection( section1Name ) )
with expansion:
!false
-------------------------------------------------------------------------------
section tracking
-------------------------------------------------------------------------------
@@ -6869,24 +6570,6 @@ section tracking
SectionTrackerTests.cpp:<line number>
...............................................................................
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.enterSection( section1Name ) )
with expansion:
!false
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.enterSection( section2Name ) )
with expansion:
!false
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.isCompleted() )
with expansion:
!false
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK( testCaseTracker.enterSection( section1Name ) )
@@ -6942,36 +6625,6 @@ section tracking
SectionTrackerTests.cpp:<line number>
...............................................................................
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.enterSection( section1Name ) )
with expansion:
!false
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.isCompleted() )
with expansion:
!false
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK( testCaseTracker.enterSection( section1Name ) )
with expansion:
true
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.enterSection( section2Name ) )
with expansion:
!false
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.isCompleted() )
with expansion:
!false
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK( testCaseTracker.enterSection( section1Name ) )
@@ -6984,6 +6637,12 @@ PASSED:
with expansion:
true
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK_FALSE( testCaseTracker.isCompleted() )
with expansion:
!false
SectionTrackerTests.cpp:<line number>:
PASSED:
CHECK( testCaseTracker.isCompleted() )
@@ -6991,5 +6650,5 @@ with expansion:
true
===============================================================================
125 test cases - 53 failed (680 assertions - 112 failed)
125 test cases - 53 failed (646 assertions - 110 failed)