mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 07:16:10 +01:00
ITracker::parent returns pointer not reference
We were already using it mostly to get pointers rather than references, so this makes it make more sense.
This commit is contained in:
parent
4ce8a23edd
commit
a14d67cace
@ -50,7 +50,7 @@ namespace Catch {
|
|||||||
// without it, the code above creates 5 nested generators.
|
// without it, the code above creates 5 nested generators.
|
||||||
if ( currentTracker.nameAndLocation() == nameAndLocation ) {
|
if ( currentTracker.nameAndLocation() == nameAndLocation ) {
|
||||||
auto thisTracker =
|
auto thisTracker =
|
||||||
currentTracker.parent().findChild( nameAndLocation );
|
currentTracker.parent()->findChild( nameAndLocation );
|
||||||
assert( thisTracker );
|
assert( thisTracker );
|
||||||
assert( thisTracker->isGeneratorTracker() );
|
assert( thisTracker->isGeneratorTracker() );
|
||||||
tracker = static_cast<GeneratorTracker*>( thisTracker );
|
tracker = static_cast<GeneratorTracker*>( thisTracker );
|
||||||
@ -110,7 +110,7 @@ namespace Catch {
|
|||||||
// This is safe: there is always at least one section
|
// This is safe: there is always at least one section
|
||||||
// tracker in a test case tracking tree
|
// tracker in a test case tracking tree
|
||||||
while ( !parent->isSectionTracker() ) {
|
while ( !parent->isSectionTracker() ) {
|
||||||
parent = &( parent->parent() );
|
parent = parent->parent();
|
||||||
}
|
}
|
||||||
assert( parent &&
|
assert( parent &&
|
||||||
"Missing root (test case) level section" );
|
"Missing root (test case) level section" );
|
||||||
|
@ -99,9 +99,9 @@ namespace TestCaseTracking {
|
|||||||
return m_runState != NotStarted && !isComplete();
|
return m_runState != NotStarted && !isComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
ITracker& TrackerBase::parent() {
|
ITracker* TrackerBase::parent() {
|
||||||
assert( m_parent ); // Should always be non-null except for root
|
assert( m_parent ); // Should always be non-null except for root
|
||||||
return *m_parent;
|
return m_parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrackerBase::openChild() {
|
void TrackerBase::openChild() {
|
||||||
@ -176,7 +176,7 @@ namespace TestCaseTracking {
|
|||||||
{
|
{
|
||||||
if( parent ) {
|
if( parent ) {
|
||||||
while( !parent->isSectionTracker() )
|
while( !parent->isSectionTracker() )
|
||||||
parent = &parent->parent();
|
parent = parent->parent();
|
||||||
|
|
||||||
SectionTracker& parentSection = static_cast<SectionTracker&>( *parent );
|
SectionTracker& parentSection = static_cast<SectionTracker&>( *parent );
|
||||||
addNextFilters( parentSection.m_filters );
|
addNextFilters( parentSection.m_filters );
|
||||||
|
@ -60,7 +60,7 @@ namespace TestCaseTracking {
|
|||||||
virtual bool isOpen() const = 0; // Started but not complete
|
virtual bool isOpen() const = 0; // Started but not complete
|
||||||
virtual bool hasStarted() const = 0;
|
virtual bool hasStarted() const = 0;
|
||||||
|
|
||||||
virtual ITracker& parent() = 0;
|
virtual ITracker* parent() = 0;
|
||||||
|
|
||||||
// actions
|
// actions
|
||||||
virtual void close() = 0; // Successfully complete
|
virtual void close() = 0; // Successfully complete
|
||||||
@ -138,7 +138,7 @@ namespace TestCaseTracking {
|
|||||||
return m_runState != NotStarted;
|
return m_runState != NotStarted;
|
||||||
}
|
}
|
||||||
|
|
||||||
ITracker& parent() override;
|
ITracker* parent() override;
|
||||||
|
|
||||||
void openChild() override;
|
void openChild() override;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user