From 64a9c02315c7ca770a575daa214b2db3bd70bb37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Sun, 27 Jan 2019 16:04:02 +0100 Subject: [PATCH] Remove obsolete IndexTracker --- include/internal/catch_test_case_tracker.cpp | 44 -- include/internal/catch_test_case_tracker.h | 17 - .../Baselines/compact.sw.approved.txt | 63 --- .../Baselines/console.std.approved.txt | 2 +- .../Baselines/console.sw.approved.txt | 407 +------------ .../SelfTest/Baselines/junit.sw.approved.txt | 9 +- .../SelfTest/Baselines/xml.sw.approved.txt | 535 +----------------- .../IntrospectiveTests/PartTracker.tests.cpp | 150 ----- 8 files changed, 5 insertions(+), 1222 deletions(-) diff --git a/include/internal/catch_test_case_tracker.cpp b/include/internal/catch_test_case_tracker.cpp index 8c18845775..f6e5ac081d 100644 --- a/include/internal/catch_test_case_tracker.cpp +++ b/include/internal/catch_test_case_tracker.cpp @@ -238,55 +238,11 @@ namespace TestCaseTracking { m_filters.insert( m_filters.end(), ++filters.begin(), filters.end() ); } - IndexTracker::IndexTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent, int size ) - : TrackerBase( nameAndLocation, ctx, parent ), - m_size( size ) - {} - - bool IndexTracker::isIndexTracker() const { return true; } - - IndexTracker& IndexTracker::acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation, int size ) { - std::shared_ptr tracker; - - ITracker& currentTracker = ctx.currentTracker(); - if( ITrackerPtr childTracker = currentTracker.findChild( nameAndLocation ) ) { - assert( childTracker ); - assert( childTracker->isIndexTracker() ); - tracker = std::static_pointer_cast( childTracker ); - } - else { - tracker = std::make_shared( nameAndLocation, ctx, ¤tTracker, size ); - currentTracker.addChild( tracker ); - } - - if( !ctx.completedCycle() && !tracker->isComplete() ) { - if( tracker->m_runState != ExecutingChildren && tracker->m_runState != NeedsAnotherRun ) - tracker->moveNext(); - tracker->open(); - } - - return *tracker; - } - - int IndexTracker::index() const { return m_index; } - - void IndexTracker::moveNext() { - m_index++; - m_children.clear(); - } - - void IndexTracker::close() { - TrackerBase::close(); - if( m_runState == CompletedSuccessfully && m_index < m_size-1 ) - m_runState = Executing; - } - } // namespace TestCaseTracking using TestCaseTracking::ITracker; using TestCaseTracking::TrackerContext; using TestCaseTracking::SectionTracker; -using TestCaseTracking::IndexTracker; } // namespace Catch diff --git a/include/internal/catch_test_case_tracker.h b/include/internal/catch_test_case_tracker.h index 485118ed4f..e873d788e2 100644 --- a/include/internal/catch_test_case_tracker.h +++ b/include/internal/catch_test_case_tracker.h @@ -150,28 +150,11 @@ namespace TestCaseTracking { void addNextFilters( std::vector const& filters ); }; - class IndexTracker : public TrackerBase { - int m_size; - int m_index = -1; - public: - IndexTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent, int size ); - - bool isIndexTracker() const override; - void close() override; - - static IndexTracker& acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation, int size ); - - int index() const; - - void moveNext(); - }; - } // namespace TestCaseTracking using TestCaseTracking::ITracker; using TestCaseTracking::TrackerContext; using TestCaseTracking::SectionTracker; -using TestCaseTracking::IndexTracker; } // namespace Catch diff --git a/projects/SelfTest/Baselines/compact.sw.approved.txt b/projects/SelfTest/Baselines/compact.sw.approved.txt index 547678ceaf..72627f1fb5 100644 --- a/projects/SelfTest/Baselines/compact.sw.approved.txt +++ b/projects/SelfTest/Baselines/compact.sw.approved.txt @@ -1034,69 +1034,6 @@ PartTracker.tests.cpp:: passed: s1.isComplete() == false for: false PartTracker.tests.cpp:: passed: s1.isComplete() for: true PartTracker.tests.cpp:: passed: testCase.isComplete() == false for: false == false PartTracker.tests.cpp:: passed: testCase.isComplete() for: true -PartTracker.tests.cpp:: passed: testCase.isOpen() for: true -PartTracker.tests.cpp:: passed: s1.isOpen() for: true -PartTracker.tests.cpp:: passed: g1.isOpen() for: true -PartTracker.tests.cpp:: passed: g1.index() == 0 for: 0 == 0 -PartTracker.tests.cpp:: passed: g1.isComplete() == false for: false == false -PartTracker.tests.cpp:: passed: s1.isComplete() == false for: false == false -PartTracker.tests.cpp:: passed: s1.isComplete() == false for: false == false -PartTracker.tests.cpp:: passed: testCase.isSuccessfullyCompleted() == false for: false == false -PartTracker.tests.cpp:: passed: testCase2.isOpen() for: true -PartTracker.tests.cpp:: passed: s1b.isOpen() for: true -PartTracker.tests.cpp:: passed: g1b.isOpen() for: true -PartTracker.tests.cpp:: passed: g1b.index() == 1 for: 1 == 1 -PartTracker.tests.cpp:: passed: s1.isComplete() == false for: false == false -PartTracker.tests.cpp:: passed: s1b.isComplete() for: true -PartTracker.tests.cpp:: passed: g1b.isComplete() for: true -PartTracker.tests.cpp:: passed: testCase2.isComplete() for: true -PartTracker.tests.cpp:: passed: testCase.isOpen() for: true -PartTracker.tests.cpp:: passed: s1.isOpen() for: true -PartTracker.tests.cpp:: passed: g1.isOpen() for: true -PartTracker.tests.cpp:: passed: g1.index() == 0 for: 0 == 0 -PartTracker.tests.cpp:: passed: g1.isComplete() == false for: false == false -PartTracker.tests.cpp:: passed: s1.isComplete() == false for: false == false -PartTracker.tests.cpp:: passed: s2.isOpen() for: true -PartTracker.tests.cpp:: passed: s2.isComplete() for: true -PartTracker.tests.cpp:: passed: s1.isComplete() == false for: false == false -PartTracker.tests.cpp:: passed: testCase.isComplete() == false for: false == false -PartTracker.tests.cpp:: passed: testCase2.isOpen() for: true -PartTracker.tests.cpp:: passed: s1b.isOpen() for: true -PartTracker.tests.cpp:: passed: g1b.isOpen() for: true -PartTracker.tests.cpp:: passed: g1b.index() == 1 for: 1 == 1 -PartTracker.tests.cpp:: passed: s2b.isOpen() for: true -PartTracker.tests.cpp:: passed: s2b.isComplete() for: true -PartTracker.tests.cpp:: passed: g1b.isComplete() for: true -PartTracker.tests.cpp:: passed: s1b.isComplete() for: true -PartTracker.tests.cpp:: passed: testCase2.isComplete() for: true -PartTracker.tests.cpp:: passed: testCase.isOpen() for: true -PartTracker.tests.cpp:: passed: s1.isOpen() for: true -PartTracker.tests.cpp:: passed: g1.isOpen() for: true -PartTracker.tests.cpp:: passed: g1.index() == 0 for: 0 == 0 -PartTracker.tests.cpp:: passed: g1.isComplete() == false for: false == false -PartTracker.tests.cpp:: passed: s1.isComplete() == false for: false == false -PartTracker.tests.cpp:: passed: s2.isOpen() for: true -PartTracker.tests.cpp:: passed: s2.isComplete() for: true -PartTracker.tests.cpp:: passed: s2.isSuccessfullyCompleted() == false for: false == false -PartTracker.tests.cpp:: passed: s1.isComplete() == false for: false == false -PartTracker.tests.cpp:: passed: testCase.isComplete() == false for: false == false -PartTracker.tests.cpp:: passed: testCase2.isOpen() for: true -PartTracker.tests.cpp:: passed: s1b.isOpen() for: true -PartTracker.tests.cpp:: passed: g1b.isOpen() for: true -PartTracker.tests.cpp:: passed: g1b.index() == 0 for: 0 == 0 -PartTracker.tests.cpp:: passed: s2b.isOpen() == false for: false == false -PartTracker.tests.cpp:: passed: g1b.isComplete() == false for: false == false -PartTracker.tests.cpp:: passed: s1b.isComplete() == false for: false == false -PartTracker.tests.cpp:: passed: testCase2.isComplete() == false for: false == false -PartTracker.tests.cpp:: passed: testCase3.isOpen() for: true -PartTracker.tests.cpp:: passed: s1c.isOpen() for: true -PartTracker.tests.cpp:: passed: g1c.isOpen() for: true -PartTracker.tests.cpp:: passed: g1c.index() == 1 for: 1 == 1 -PartTracker.tests.cpp:: passed: s2c.isOpen() for: true -PartTracker.tests.cpp:: passed: s2c.isComplete() for: true -PartTracker.tests.cpp:: passed: g1c.isComplete() for: true -PartTracker.tests.cpp:: passed: s1c.isComplete() for: true -PartTracker.tests.cpp:: passed: testCase3.isComplete() for: true Exception.tests.cpp:: failed: unexpected exception with message: '3.14' Approx.tests.cpp:: passed: d == approx( 1.23 ) for: 1.23 == Approx( 1.23 ) Approx.tests.cpp:: passed: d == approx( 1.22 ) for: 1.23 == Approx( 1.22 ) diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt index df483fda23..dff912cf6e 100644 --- a/projects/SelfTest/Baselines/console.std.approved.txt +++ b/projects/SelfTest/Baselines/console.std.approved.txt @@ -1171,5 +1171,5 @@ due to unexpected exception with message: =============================================================================== test cases: 243 | 183 passed | 56 failed | 4 failed as expected -assertions: 1325 | 1189 passed | 115 failed | 21 failed as expected +assertions: 1262 | 1126 passed | 115 failed | 21 failed as expected diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt index 7069d0b126..79334630c1 100644 --- a/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/projects/SelfTest/Baselines/console.sw.approved.txt @@ -7932,411 +7932,6 @@ PartTracker.tests.cpp:: PASSED: with expansion: true -------------------------------------------------------------------------------- -Tracker -------------------------------------------------------------------------------- -PartTracker.tests.cpp: -............................................................................... - -PartTracker.tests.cpp:: PASSED: - REQUIRE( testCase.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s1.isOpen() ) -with expansion: - true - -------------------------------------------------------------------------------- -Tracker - start a generator -------------------------------------------------------------------------------- -PartTracker.tests.cpp: -............................................................................... - -PartTracker.tests.cpp:: PASSED: - REQUIRE( g1.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( g1.index() == 0 ) -with expansion: - 0 == 0 - -PartTracker.tests.cpp:: PASSED: - REQUIRE( g1.isComplete() == false ) -with expansion: - false == false - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s1.isComplete() == false ) -with expansion: - false == false - -------------------------------------------------------------------------------- -Tracker - start a generator - close outer section -------------------------------------------------------------------------------- -PartTracker.tests.cpp: -............................................................................... - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s1.isComplete() == false ) -with expansion: - false == false - -PartTracker.tests.cpp:: PASSED: - REQUIRE( testCase.isSuccessfullyCompleted() == false ) -with expansion: - false == false - -------------------------------------------------------------------------------- -Tracker - start a generator - close outer section - Re-enter for second generation -------------------------------------------------------------------------------- -PartTracker.tests.cpp: -............................................................................... - -PartTracker.tests.cpp:: PASSED: - REQUIRE( testCase2.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s1b.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( g1b.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( g1b.index() == 1 ) -with expansion: - 1 == 1 - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s1.isComplete() == false ) -with expansion: - false == false - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s1b.isComplete() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( g1b.isComplete() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( testCase2.isComplete() ) -with expansion: - true - -------------------------------------------------------------------------------- -Tracker -------------------------------------------------------------------------------- -PartTracker.tests.cpp: -............................................................................... - -PartTracker.tests.cpp:: PASSED: - REQUIRE( testCase.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s1.isOpen() ) -with expansion: - true - -------------------------------------------------------------------------------- -Tracker - start a generator -------------------------------------------------------------------------------- -PartTracker.tests.cpp: -............................................................................... - -PartTracker.tests.cpp:: PASSED: - REQUIRE( g1.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( g1.index() == 0 ) -with expansion: - 0 == 0 - -PartTracker.tests.cpp:: PASSED: - REQUIRE( g1.isComplete() == false ) -with expansion: - false == false - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s1.isComplete() == false ) -with expansion: - false == false - -------------------------------------------------------------------------------- -Tracker - start a generator - Start a new inner section -------------------------------------------------------------------------------- -PartTracker.tests.cpp: -............................................................................... - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s2.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s2.isComplete() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s1.isComplete() == false ) -with expansion: - false == false - -PartTracker.tests.cpp:: PASSED: - REQUIRE( testCase.isComplete() == false ) -with expansion: - false == false - -------------------------------------------------------------------------------- -Tracker - start a generator - Start a new inner section - Re-enter for second generation -------------------------------------------------------------------------------- -PartTracker.tests.cpp: -............................................................................... - -PartTracker.tests.cpp:: PASSED: - REQUIRE( testCase2.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s1b.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( g1b.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( g1b.index() == 1 ) -with expansion: - 1 == 1 - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s2b.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s2b.isComplete() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( g1b.isComplete() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s1b.isComplete() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( testCase2.isComplete() ) -with expansion: - true - -------------------------------------------------------------------------------- -Tracker -------------------------------------------------------------------------------- -PartTracker.tests.cpp: -............................................................................... - -PartTracker.tests.cpp:: PASSED: - REQUIRE( testCase.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s1.isOpen() ) -with expansion: - true - -------------------------------------------------------------------------------- -Tracker - start a generator -------------------------------------------------------------------------------- -PartTracker.tests.cpp: -............................................................................... - -PartTracker.tests.cpp:: PASSED: - REQUIRE( g1.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( g1.index() == 0 ) -with expansion: - 0 == 0 - -PartTracker.tests.cpp:: PASSED: - REQUIRE( g1.isComplete() == false ) -with expansion: - false == false - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s1.isComplete() == false ) -with expansion: - false == false - -------------------------------------------------------------------------------- -Tracker - start a generator - Fail an inner section -------------------------------------------------------------------------------- -PartTracker.tests.cpp: -............................................................................... - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s2.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s2.isComplete() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s2.isSuccessfullyCompleted() == false ) -with expansion: - false == false - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s1.isComplete() == false ) -with expansion: - false == false - -PartTracker.tests.cpp:: PASSED: - REQUIRE( testCase.isComplete() == false ) -with expansion: - false == false - -------------------------------------------------------------------------------- -Tracker - start a generator - Fail an inner section - Re-enter for second generation -------------------------------------------------------------------------------- -PartTracker.tests.cpp: -............................................................................... - -PartTracker.tests.cpp:: PASSED: - REQUIRE( testCase2.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s1b.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( g1b.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( g1b.index() == 0 ) -with expansion: - 0 == 0 - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s2b.isOpen() == false ) -with expansion: - false == false - -PartTracker.tests.cpp:: PASSED: - REQUIRE( g1b.isComplete() == false ) -with expansion: - false == false - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s1b.isComplete() == false ) -with expansion: - false == false - -PartTracker.tests.cpp:: PASSED: - REQUIRE( testCase2.isComplete() == false ) -with expansion: - false == false - -PartTracker.tests.cpp:: PASSED: - REQUIRE( testCase3.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s1c.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( g1c.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( g1c.index() == 1 ) -with expansion: - 1 == 1 - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s2c.isOpen() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s2c.isComplete() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( g1c.isComplete() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( s1c.isComplete() ) -with expansion: - true - -PartTracker.tests.cpp:: PASSED: - REQUIRE( testCase3.isComplete() ) -with expansion: - true - ------------------------------------------------------------------------------- Unexpected exceptions can be translated ------------------------------------------------------------------------------- @@ -10630,5 +10225,5 @@ Misc.tests.cpp:: PASSED: =============================================================================== test cases: 243 | 170 passed | 69 failed | 4 failed as expected -assertions: 1339 | 1189 passed | 129 failed | 21 failed as expected +assertions: 1276 | 1126 passed | 129 failed | 21 failed as expected diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt index beb8b459da..17cc828110 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,7 +1,7 @@ - + @@ -691,13 +691,6 @@ Exception.tests.cpp: - - - - - - - 3.14 diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index b2d0c61e28..497d81684a 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -9193,537 +9193,6 @@ Message from section two - - - testCase.isOpen() - - - true - - - - - s1.isOpen() - - - true - - -
- - - g1.isOpen() - - - true - - - - - g1.index() == 0 - - - 0 == 0 - - - - - g1.isComplete() == false - - - false == false - - - - - s1.isComplete() == false - - - false == false - - -
- - - s1.isComplete() == false - - - false == false - - - - - testCase.isSuccessfullyCompleted() == false - - - false == false - - -
- - - testCase2.isOpen() - - - true - - - - - s1b.isOpen() - - - true - - - - - g1b.isOpen() - - - true - - - - - g1b.index() == 1 - - - 1 == 1 - - - - - s1.isComplete() == false - - - false == false - - - - - s1b.isComplete() - - - true - - - - - g1b.isComplete() - - - true - - - - - testCase2.isComplete() - - - true - - - -
- -
- -
- - - testCase.isOpen() - - - true - - - - - s1.isOpen() - - - true - - -
- - - g1.isOpen() - - - true - - - - - g1.index() == 0 - - - 0 == 0 - - - - - g1.isComplete() == false - - - false == false - - - - - s1.isComplete() == false - - - false == false - - -
- - - s2.isOpen() - - - true - - - - - s2.isComplete() - - - true - - - - - s1.isComplete() == false - - - false == false - - - - - testCase.isComplete() == false - - - false == false - - -
- - - testCase2.isOpen() - - - true - - - - - s1b.isOpen() - - - true - - - - - g1b.isOpen() - - - true - - - - - g1b.index() == 1 - - - 1 == 1 - - - - - s2b.isOpen() - - - true - - - - - s2b.isComplete() - - - true - - - - - g1b.isComplete() - - - true - - - - - s1b.isComplete() - - - true - - - - - testCase2.isComplete() - - - true - - - -
- -
- -
- - - testCase.isOpen() - - - true - - - - - s1.isOpen() - - - true - - -
- - - g1.isOpen() - - - true - - - - - g1.index() == 0 - - - 0 == 0 - - - - - g1.isComplete() == false - - - false == false - - - - - s1.isComplete() == false - - - false == false - - -
- - - s2.isOpen() - - - true - - - - - s2.isComplete() - - - true - - - - - s2.isSuccessfullyCompleted() == false - - - false == false - - - - - s1.isComplete() == false - - - false == false - - - - - testCase.isComplete() == false - - - false == false - - -
- - - testCase2.isOpen() - - - true - - - - - s1b.isOpen() - - - true - - - - - g1b.isOpen() - - - true - - - - - g1b.index() == 0 - - - 0 == 0 - - - - - s2b.isOpen() == false - - - false == false - - - - - g1b.isComplete() == false - - - false == false - - - - - s1b.isComplete() == false - - - false == false - - - - - testCase2.isComplete() == false - - - false == false - - - - - testCase3.isOpen() - - - true - - - - - s1c.isOpen() - - - true - - - - - g1c.isOpen() - - - true - - - - - g1c.index() == 1 - - - 1 == 1 - - - - - s2c.isOpen() - - - true - - - - - s2c.isComplete() - - - true - - - - - g1c.isComplete() - - - true - - - - - s1c.isComplete() - - - true - - - - - testCase3.isComplete() - - - true - - - -
- -
- -
@@ -12264,7 +11733,7 @@ loose text artifact - + - + diff --git a/projects/SelfTest/IntrospectiveTests/PartTracker.tests.cpp b/projects/SelfTest/IntrospectiveTests/PartTracker.tests.cpp index 12dcca91fc..9372b1c3b1 100644 --- a/projects/SelfTest/IntrospectiveTests/PartTracker.tests.cpp +++ b/projects/SelfTest/IntrospectiveTests/PartTracker.tests.cpp @@ -173,156 +173,6 @@ TEST_CASE( "Tracker" ) { testCase.close(); REQUIRE( testCase.isComplete() ); } - - SECTION( "start a generator" ) { - IndexTracker& g1 = IndexTracker::acquire( ctx, makeNAL( "G1" ), 2 ); - REQUIRE( g1.isOpen() ); - REQUIRE( g1.index() == 0 ); - - REQUIRE( g1.isComplete() == false ); - REQUIRE( s1.isComplete() == false ); - - SECTION( "close outer section" ) - { - s1.close(); - REQUIRE( s1.isComplete() == false ); - testCase.close(); - REQUIRE( testCase.isSuccessfullyCompleted() == false ); - - SECTION( "Re-enter for second generation" ) { - ctx.startCycle(); - ITracker& testCase2 = SectionTracker::acquire( ctx, makeNAL( "Testcase" ) ); - REQUIRE( testCase2.isOpen() ); - - ITracker& s1b = SectionTracker::acquire( ctx, makeNAL( "S1" ) ); - REQUIRE( s1b.isOpen() ); - - - IndexTracker& g1b = IndexTracker::acquire( ctx, makeNAL( "G1" ), 2 ); - REQUIRE( g1b.isOpen() ); - REQUIRE( g1b.index() == 1 ); - - REQUIRE( s1.isComplete() == false ); - - s1b.close(); - REQUIRE( s1b.isComplete() ); - REQUIRE( g1b.isComplete() ); - testCase2.close(); - REQUIRE( testCase2.isComplete() ); - } - } - SECTION( "Start a new inner section" ) { - ITracker& s2 = SectionTracker::acquire( ctx, makeNAL( "S2" ) ); - REQUIRE( s2.isOpen() ); - - s2.close(); - REQUIRE( s2.isComplete() ); - - s1.close(); - REQUIRE( s1.isComplete() == false ); - - testCase.close(); - REQUIRE( testCase.isComplete() == false ); - - SECTION( "Re-enter for second generation" ) { - ctx.startCycle(); - ITracker& testCase2 = SectionTracker::acquire( ctx, makeNAL( "Testcase" ) ); - REQUIRE( testCase2.isOpen() ); - - ITracker& s1b = SectionTracker::acquire( ctx, makeNAL( "S1" ) ); - REQUIRE( s1b.isOpen() ); - - // generator - next value - IndexTracker& g1b = IndexTracker::acquire( ctx, makeNAL( "G1" ), 2 ); - REQUIRE( g1b.isOpen() ); - REQUIRE( g1b.index() == 1 ); - - // inner section again - ITracker& s2b = SectionTracker::acquire( ctx, makeNAL( "S2" ) ); - REQUIRE( s2b.isOpen() ); - - s2b.close(); - REQUIRE( s2b.isComplete() ); - - s1b.close(); - REQUIRE( g1b.isComplete() ); - REQUIRE( s1b.isComplete() ); - - testCase2.close(); - REQUIRE( testCase2.isComplete() ); - } - } - - SECTION( "Fail an inner section" ) { - ITracker& s2 = SectionTracker::acquire( ctx, makeNAL( "S2" ) ); - REQUIRE( s2.isOpen() ); - - s2.fail(); - REQUIRE( s2.isComplete() ); - REQUIRE( s2.isSuccessfullyCompleted() == false ); - - s1.close(); - REQUIRE( s1.isComplete() == false ); - - testCase.close(); - REQUIRE( testCase.isComplete() == false ); - - SECTION( "Re-enter for second generation" ) { - ctx.startCycle(); - ITracker& testCase2 = SectionTracker::acquire( ctx, makeNAL( "Testcase" ) ); - REQUIRE( testCase2.isOpen() ); - - ITracker& s1b = SectionTracker::acquire( ctx, makeNAL( "S1" ) ); - REQUIRE( s1b.isOpen() ); - - // generator - still same value - IndexTracker& g1b = IndexTracker::acquire( ctx, makeNAL( "G1" ), 2 ); - REQUIRE( g1b.isOpen() ); - REQUIRE( g1b.index() == 0 ); - - // inner section again - this time won't open - ITracker& s2b = SectionTracker::acquire( ctx, makeNAL( "S2" ) ); - REQUIRE( s2b.isOpen() == false ); - - s1b.close(); - REQUIRE( g1b.isComplete() == false ); - REQUIRE( s1b.isComplete() == false ); - - testCase2.close(); - REQUIRE( testCase2.isComplete() == false ); - - // Another cycle - now should complete - ctx.startCycle(); - ITracker& testCase3 = SectionTracker::acquire( ctx, makeNAL( "Testcase" ) ); - REQUIRE( testCase3.isOpen() ); - - ITracker& s1c = SectionTracker::acquire( ctx, makeNAL( "S1" ) ); - REQUIRE( s1c.isOpen() ); - - // generator - now next value - IndexTracker& g1c = IndexTracker::acquire( ctx, makeNAL( "G1" ), 2 ); - REQUIRE( g1c.isOpen() ); - REQUIRE( g1c.index() == 1 ); - - // inner section - now should open again - ITracker& s2c = SectionTracker::acquire( ctx, makeNAL( "S2" ) ); - REQUIRE( s2c.isOpen() ); - - s2c.close(); - REQUIRE( s2c.isComplete() ); - - s1c.close(); - REQUIRE( g1c.isComplete() ); - REQUIRE( s1c.isComplete() ); - - testCase3.close(); - REQUIRE( testCase3.isComplete() ); - } - } - // !TBD" - // nested generator - // two sections within a generator - } } static bool previouslyRun = false;