Move default impls of isFooTracker to the interface

This commit is contained in:
Martin Hořeňovský 2021-06-10 00:02:40 +02:00
parent c064322a9d
commit 61461dfd1d
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
2 changed files with 16 additions and 9 deletions

View File

@ -45,6 +45,8 @@ namespace TestCaseTracking {
return ( it != m_children.end() ) ? it->get() : nullptr;
}
bool ITracker::isSectionTracker() const { return false; }
bool ITracker::isGeneratorTracker() const { return false; }
ITracker& TrackerContext::startRun() {
@ -106,9 +108,6 @@ namespace TestCaseTracking {
}
}
bool TrackerBase::isSectionTracker() const { return false; }
bool TrackerBase::isGeneratorTracker() const { return false; }
void TrackerBase::open() {
m_runState = Executing;
moveToThis();

View File

@ -86,9 +86,20 @@ namespace TestCaseTracking {
virtual void openChild() = 0;
// Debug/ checking
virtual bool isSectionTracker() const = 0;
virtual bool isGeneratorTracker() const = 0;
/**
* Returns true if the instance is a section tracker
*
* Subclasses should override to true if they are, replaces RTTI
* for internal debug checks.
*/
virtual bool isSectionTracker() const;
/**
* Returns true if the instance is a generator tracker
*
* Subclasses should override to true if they are, replaces RTTI
* for internal debug checks.
*/
virtual bool isGeneratorTracker() const;
};
class TrackerContext {
@ -142,9 +153,6 @@ namespace TestCaseTracking {
void openChild() override;
bool isSectionTracker() const override;
bool isGeneratorTracker() const override;
void open();
void close() override;