Ejemplo n.º 1
0
// Called from the TestRunnerThread.
void 
TestRunnerModel::addFailure( const CPPUNIT_NS::TestFailure &failure )
{
  addFailureInfo( new TestFailureInfo( failure.failedTest(), 
                                       failure.thrownException(),
                                       failure.isError() ) );
}
Ejemplo n.º 2
0
void 
MockTestListener::addFailure( const CPPUNIT_NS::TestFailure &failure )
{
  if ( m_hasExpectationForAddFailure  ||  m_hasExpectationForSomeFailure )
    ++m_addFailureCall;

  if ( m_hasExpectationForAddFailure )
  {
    CPPUNIT_ASSERT_MESSAGE( m_name + ": unexpected call",
                            m_addFailureCall <= m_expectedAddFailureCallCount );
  }

  if ( m_hasParametersExpectationForAddFailure )
  {
    CPPUNIT_ASSERT_MESSAGE( m_name + ": bad test",
                            m_expectedFailedTest == failure.failedTest() );
    CPPUNIT_ASSERT_MESSAGE( m_name + ": bad thrownException",
                            m_expectedException == failure.thrownException() );
    CPPUNIT_ASSERT_MESSAGE( m_name + ": bad isError",
                            m_expectedIsError == failure.isError() );
  }
}
Ejemplo n.º 3
0
 void addFailure(const CPPUNIT_NS::TestFailure &failure) {
     CPPUNIT_NS::stdCOut() << " : " << (failure.isError() ? "error" : "assertion");
     m_lastTestFailed = true;
 }
Ejemplo n.º 4
0
	virtual void addFailure( const CPPUNIT_NS::TestFailure & failure ) {
		const CPPUNIT_NS::SourceLine solurceLine( failure.sourceLine() );
		CPPUNIT_NS::Message message( failure.thrownException()->message() );
		std::cout << solurceLine.fileName() << ' ' << solurceLine.lineNumber() << ' ' << message.shortDescription() << std::endl;
		std::cout << message.details() << std::endl << std::endl;
	}