diff --git a/include/internal/catch_running_test.hpp b/include/internal/catch_running_test.hpp index 6f0ec7bf..7f89ab70 100644 --- a/include/internal/catch_running_test.hpp +++ b/include/internal/catch_running_test.hpp @@ -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; } } diff --git a/include/internal/catch_section_info.hpp b/include/internal/catch_section_info.hpp index e28f3147..7f09a943 100644 --- a/include/internal/catch_section_info.hpp +++ b/include/internal/catch_section_info.hpp @@ -22,7 +22,7 @@ namespace Catch { virtual const ISectionInfo* getParent() const = 0; }; - class SectionInfo : ISectionInfo { + class SectionInfo : public ISectionInfo { public: typedef std::vector 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() {