void ResultBuilder::handleResult( AssertionResult const& result )
 {
     getResultCapture().assertionEnded( result );
     
     if( !result.isOk() ) {
         if( getCurrentContext().getConfig()->shouldDebugBreak() )
             m_shouldDebugBreak = true;
         if( getCurrentContext().getRunner()->aborting() || (m_assertionInfo.resultDisposition & ResultDisposition::Normal) )
             m_shouldThrow = true;
     }
 }
示例#2
0
    void ResultBuilder::captureExpression() {
        AssertionResult result = build();
        getResultCapture().assertionEnded( result );

        if( !result.isOk() ) {
            if( getCurrentContext().getConfig()->shouldDebugBreak() )
                m_shouldDebugBreak = true;
            if( getCurrentContext().getRunner()->aborting() || m_assertionInfo.resultDisposition == ResultDisposition::Normal )
                m_shouldThrow = true;
        }
    }
示例#3
0
        virtual void assertionEnded( AssertionResult const& result ) {
            if( result.getResultType() == ResultWas::Ok ) {
                m_totals.assertions.passed++;
            }
            else if( !result.isOk() ) {
                m_totals.assertions.failed++;
            }

            if( m_reporter->assertionEnded( AssertionStats( result, m_messages, m_totals ) ) )
                m_messages.clear();

            // Reset working state
            m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after the reported line}" , m_lastAssertionInfo.resultDisposition );
        }
        virtual void assertionEnded( AssertionResult const& result ) {
            if( result.getResultType() == ResultWas::Ok ) {
                m_totals.assertions.passed++;
            }
            else if( !result.isOk() ) {
                if( m_activeTestCase->getTestCaseInfo().okToFail() )
                    m_totals.assertions.failedButOk++;
                else
                    m_totals.assertions.failed++;
            }

            // We have no use for the return value (whether messages should be cleared), because messages were made scoped
            // and should be let to clear themselves out.
            static_cast<void>(m_reporter->assertionEnded(AssertionStats(result, m_messages, m_totals)));

            // Reset working state
            m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after the reported line}" , m_lastAssertionInfo.resultDisposition );
            m_lastResult = result;
        }
示例#5
0
    void RunContext::assertionEnded(AssertionResult const & result) {
        if (result.getResultType() == ResultWas::Ok) {
            m_totals.assertions.passed++;
            m_lastAssertionPassed = true;
        } else if (!result.isOk()) {
            m_lastAssertionPassed = false;
            if( m_activeTestCase->getTestCaseInfo().okToFail() )
                m_totals.assertions.failedButOk++;
            else
                m_totals.assertions.failed++;
        }
        else {
            m_lastAssertionPassed = true;
        }

        // We have no use for the return value (whether messages should be cleared), because messages were made scoped
        // and should be let to clear themselves out.
        static_cast<void>(m_reporter->assertionEnded(AssertionStats(result, m_messages, m_totals)));

        // Reset working state
        resetAssertionInfo();
        m_lastResult = result;
    }
 virtual void prepareExpandedExpression( AssertionResult& result ) const {
     if( result.isOk() )
         result.discardDecomposedExpression();
     else
         result.expandDecomposedExpression();
 }