mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-30 19:57:10 +01:00 
			
		
		
		
	Small logic tweaks
This commit is contained in:
		| @@ -55,18 +55,14 @@ namespace Catch { | |||||||
|         } |         } | ||||||
|          |          | ||||||
|         void ranToCompletion() { |         void ranToCompletion() { | ||||||
|             if( m_runStatus == RanAtLeastOneSection || |             if( m_runStatus != RanAtLeastOneSection && m_runStatus != EncounteredASection ) | ||||||
|                 m_runStatus == EncounteredASection ) { |                 m_runStatus = RanToCompletionWithNoSections; | ||||||
|             m_runStatus = RanToCompletionWithSections; |             m_runStatus = RanToCompletionWithSections; | ||||||
|             if( m_lastSectionToRun ) { |             if( m_lastSectionToRun ) { | ||||||
|                 m_lastSectionToRun->ranToCompletion(); |                 m_lastSectionToRun->ranToCompletion(); | ||||||
|                 m_changed = true; |                 m_changed = true; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|             else { |  | ||||||
|                 m_runStatus = RanToCompletionWithNoSections; |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
|          |          | ||||||
|         bool addSection( const std::string& name ) { |         bool addSection( const std::string& name ) { | ||||||
|             if( m_runStatus == NothingRun ) |             if( m_runStatus == NothingRun ) | ||||||
|   | |||||||
| @@ -22,7 +22,7 @@ namespace Catch { | |||||||
|         virtual const ISectionInfo* getParent() const = 0; |         virtual const ISectionInfo* getParent() const = 0; | ||||||
|     }; |     }; | ||||||
|  |  | ||||||
|     class SectionInfo : ISectionInfo { |     class SectionInfo : public ISectionInfo { | ||||||
|     public: |     public: | ||||||
|  |  | ||||||
|         typedef std::vector<SectionInfo*> SubSections; |         typedef std::vector<SectionInfo*> SubSections; | ||||||
| @@ -98,12 +98,11 @@ namespace Catch { | |||||||
|         } |         } | ||||||
|  |  | ||||||
|         bool ran() { |         bool ran() { | ||||||
|             if( m_state < Branch ) { |             if( m_state >= Branch ) | ||||||
|  |                 return false; | ||||||
|             m_state = TestedLeaf; |             m_state = TestedLeaf; | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|             return false; |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         void ranToCompletion() { |         void ranToCompletion() { | ||||||
|             if( m_state == Branch && !hasUntestedSections() ) |             if( m_state == Branch && !hasUntestedSections() ) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Phil Nash
					Phil Nash