Пример #1
0
void Assert::assertFail( const Toolkit::Core::SourceLine& srcLine, const TestResultType& res, const QString& message ) const {
    TestResult testRes;

    testRes.setAssertType( TestResult::ASSERT_FAIL );
    testRes.setSourceLine( srcLine );
    testRes.setResultType( TestResultType( res ) );
    testRes.setMessage( message );
    
    m_Report->addResult( testRes.getResultType() );
    if( m_Report->willWriteResultType( testRes.getResultType() ) ) {
        m_Report->writeAssert( testRes );
    };

    throwAssertException( srcLine, testRes.getResultType().getResultType(), message );
};
Пример #2
0
void Assert::assertException( const Toolkit::Core::SourceLine& srcLine, int assertType, const QString& message, const TestResultType& resType, const QString& expName, const QString& expMessage ) const {
    TestResult testRes;

    testRes.setAssertType( assertType );
    testRes.setSourceLine( srcLine );
    testRes.setResultType( TestResultType( resType ) );
    testRes.setMessage( message );
    
    m_Report->addResult( testRes.getResultType() );
    if( m_Report->willWriteResultType( testRes.getResultType() ) ) {
        m_Report->writeAssertException( testRes, expName, expMessage );
    };

    throwAssertException( srcLine, testRes.getResultType().getResultType(), message );
};