Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorPhil Nash2012-11-29 20:11:46 +0000
committerPhil Nash2012-11-29 20:11:46 +0000
commit3d6be037e92fc1f7ac7cb65b7717bc5da2be274a (patch)
tree56c581f5a8bbf95369906f7e8c388652be34ed0e /include
parent6f2343bf644175228df02f411cbbd271fbf866e4 (diff)
downloadcatch3-3d6be037e92fc1f7ac7cb65b7717bc5da2be274a.tar.gz
Small logic tweaks
Diffstat (limited to 'include')
-rw-r--r--include/internal/catch_running_test.hpp14
-rw-r--r--include/internal/catch_section_info.hpp11
2 files changed, 10 insertions, 15 deletions
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<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() {