mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 13:26:10 +01:00
Small logic tweaks
This commit is contained in:
parent
6f2343bf64
commit
3d6be037e9
@ -55,16 +55,12 @@ namespace Catch {
|
||||
}
|
||||
|
||||
void ranToCompletion() {
|
||||
if( m_runStatus == RanAtLeastOneSection ||
|
||||
m_runStatus == EncounteredASection ) {
|
||||
m_runStatus = RanToCompletionWithSections;
|
||||
if( m_lastSectionToRun ) {
|
||||
m_lastSectionToRun->ranToCompletion();
|
||||
m_changed = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if( m_runStatus != RanAtLeastOneSection && m_runStatus != EncounteredASection )
|
||||
m_runStatus = RanToCompletionWithNoSections;
|
||||
m_runStatus = RanToCompletionWithSections;
|
||||
if( m_lastSectionToRun ) {
|
||||
m_lastSectionToRun->ranToCompletion();
|
||||
m_changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ namespace Catch {
|
||||
virtual const ISectionInfo* getParent() const = 0;
|
||||
};
|
||||
|
||||
class SectionInfo : ISectionInfo {
|
||||
class SectionInfo : public ISectionInfo {
|
||||
public:
|
||||
|
||||
typedef std::vector<SectionInfo*> SubSections;
|
||||
@ -98,11 +98,10 @@ namespace Catch {
|
||||
}
|
||||
|
||||
bool ran() {
|
||||
if( m_state < Branch ) {
|
||||
m_state = TestedLeaf;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
if( m_state >= Branch )
|
||||
return false;
|
||||
m_state = TestedLeaf;
|
||||
return true;
|
||||
}
|
||||
|
||||
void ranToCompletion() {
|
||||
|
Loading…
Reference in New Issue
Block a user