Inline some non-virtual functions in ITracker and TrackerContext

This commit is contained in:
Martin Hořeňovský 2023-02-20 15:02:41 +01:00
parent 00f259aeb2
commit 2befd98da2
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
2 changed files with 9 additions and 19 deletions

View File

@ -51,10 +51,6 @@ namespace TestCaseTracking {
bool ITracker::isSectionTracker() const { return false; }
bool ITracker::isGeneratorTracker() const { return false; }
bool ITracker::isSuccessfullyCompleted() const {
return m_runState == CompletedSuccessfully;
}
bool ITracker::isOpen() const {
return m_runState != NotStarted && !isComplete();
}
@ -81,10 +77,6 @@ namespace TestCaseTracking {
return *m_rootTracker;
}
void TrackerContext::startCycle() {
m_currentTracker = m_rootTracker.get();
m_runState = Executing;
}
void TrackerContext::completeCycle() {
m_runState = CompletedCycle;
}
@ -92,9 +84,6 @@ namespace TestCaseTracking {
bool TrackerContext::completedCycle() const {
return m_runState == CompletedCycle;
}
ITracker& TrackerContext::currentTracker() {
return *m_currentTracker;
}
void TrackerContext::setCurrentTracker( ITracker* tracker ) {
m_currentTracker = tracker;
}
@ -232,10 +221,6 @@ namespace TestCaseTracking {
m_filters.insert( m_filters.end(), filters.begin()+1, filters.end() );
}
std::vector<StringRef> const& SectionTracker::getFilters() const {
return m_filters;
}
StringRef SectionTracker::trimmedName() const {
return m_trimmed_name;
}

View File

@ -105,7 +105,9 @@ namespace TestCaseTracking {
//! Returns true if tracker run to completion (successfully or not)
virtual bool isComplete() const = 0;
//! Returns true if tracker run to completion succesfully
bool isSuccessfullyCompleted() const;
bool isSuccessfullyCompleted() const {
return m_runState == CompletedSuccessfully;
}
//! Returns true if tracker has started but hasn't been completed
bool isOpen() const;
//! Returns true iff tracker has started
@ -165,11 +167,14 @@ namespace TestCaseTracking {
ITracker& startRun();
void startCycle();
void startCycle() {
m_currentTracker = m_rootTracker.get();
m_runState = Executing;
}
void completeCycle();
bool completedCycle() const;
ITracker& currentTracker();
ITracker& currentTracker() { return *m_currentTracker; }
void setCurrentTracker( ITracker* tracker );
};
@ -214,7 +219,7 @@ namespace TestCaseTracking {
void addInitialFilters( std::vector<std::string> const& filters );
void addNextFilters( std::vector<StringRef> const& filters );
//! Returns filters active in this tracker
std::vector<StringRef> const& getFilters() const;
std::vector<StringRef> const& getFilters() const { return m_filters; }
//! Returns whitespace-trimmed name of the tracked section
StringRef trimmedName() const;
};