mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-03 21:49:32 +01:00 
			
		
		
		
	Refactored duplicated code between acceptExpression() and acceptResult()
This commit is contained in:
		@@ -406,17 +406,7 @@ namespace Catch
 | 
				
			|||||||
        )
 | 
					        )
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            m_currentResult.setResultType( result );            
 | 
					            m_currentResult.setResultType( result );            
 | 
				
			||||||
            testEnded( m_currentResult );
 | 
					            return actOnCurrentResult();
 | 
				
			||||||
 | 
					 | 
				
			||||||
            bool ok = m_currentResult.ok();
 | 
					 | 
				
			||||||
            m_currentResult = MutableResultInfo();
 | 
					 | 
				
			||||||
            if( ok )
 | 
					 | 
				
			||||||
                return ResultAction::None;
 | 
					 | 
				
			||||||
            else if( shouldDebugBreak() )
 | 
					 | 
				
			||||||
                return ResultAction::DebugFailed;
 | 
					 | 
				
			||||||
            else
 | 
					 | 
				
			||||||
                return ResultAction::Failed;
 | 
					 | 
				
			||||||
            
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ///////////////////////////////////////////////////////////////////////////
 | 
					        ///////////////////////////////////////////////////////////////////////////
 | 
				
			||||||
@@ -426,16 +416,7 @@ namespace Catch
 | 
				
			|||||||
        )
 | 
					        )
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            m_currentResult = resultInfo;
 | 
					            m_currentResult = resultInfo;
 | 
				
			||||||
            testEnded( m_currentResult );
 | 
					            return actOnCurrentResult();
 | 
				
			||||||
            
 | 
					 | 
				
			||||||
            bool ok = m_currentResult.ok();
 | 
					 | 
				
			||||||
            m_currentResult = MutableResultInfo();
 | 
					 | 
				
			||||||
            if( ok )
 | 
					 | 
				
			||||||
                return ResultAction::None;
 | 
					 | 
				
			||||||
            else if( shouldDebugBreak() )
 | 
					 | 
				
			||||||
                return ResultAction::DebugFailed;
 | 
					 | 
				
			||||||
            else
 | 
					 | 
				
			||||||
                return ResultAction::Failed;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ///////////////////////////////////////////////////////////////////////////
 | 
					        ///////////////////////////////////////////////////////////////////////////
 | 
				
			||||||
@@ -544,6 +525,22 @@ namespace Catch
 | 
				
			|||||||
        
 | 
					        
 | 
				
			||||||
    private:
 | 
					    private:
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
 | 
					        ///////////////////////////////////////////////////////////////////////////
 | 
				
			||||||
 | 
					        ResultAction::Value actOnCurrentResult
 | 
				
			||||||
 | 
					        ()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            testEnded( m_currentResult );
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
 | 
					            bool ok = m_currentResult.ok();
 | 
				
			||||||
 | 
					            m_currentResult = MutableResultInfo();
 | 
				
			||||||
 | 
					            if( ok )
 | 
				
			||||||
 | 
					                return ResultAction::None;
 | 
				
			||||||
 | 
					            else if( shouldDebugBreak() )
 | 
				
			||||||
 | 
					                return ResultAction::DebugFailed;
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					                return ResultAction::Failed;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ///////////////////////////////////////////////////////////////////////////
 | 
					        ///////////////////////////////////////////////////////////////////////////
 | 
				
			||||||
        void runCurrentTest
 | 
					        void runCurrentTest
 | 
				
			||||||
        (
 | 
					        (
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user