Changeset 477 for library/tests/unittest-cpp/TestResults.cpp
- Timestamp:
- 08/05/09 14:40:03 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/tests/unittest-cpp/TestResults.cpp
r418 r477 6 6 namespace UnitTest { 7 7 8 TestResults::TestResults(TestReporter* testReporter) 9 : m_testReporter(testReporter) 10 , m_totalTestCount(0) 11 , m_failedTestCount(0) 12 , m_failureCount(0) 13 , m_currentTestFailed(false) 14 { 8 TestResults::TestResults ( TestReporter* testReporter ) 9 : m_testReporter ( testReporter ) 10 , m_totalTestCount ( 0 ) 11 , m_failedTestCount ( 0 ) 12 , m_failureCount ( 0 ) 13 , m_currentTestFailed ( false ) { 15 14 } 16 15 17 void TestResults::OnTestStart(TestDetails const& test) 18 { 19 ++m_totalTestCount; 20 m_currentTestFailed = false; 21 if (m_testReporter) 22 m_testReporter->ReportTestStart(test); 16 void TestResults::OnTestStart ( TestDetails const& test ) { 17 ++m_totalTestCount; 18 m_currentTestFailed = false; 19 if ( m_testReporter ) 20 m_testReporter->ReportTestStart ( test ); 23 21 } 24 22 25 void TestResults::OnTestFailure(TestDetails const& test, char const* failure) 26 { 27 ++m_failureCount; 28 if (!m_currentTestFailed) 29 { 30 ++m_failedTestCount; 31 m_currentTestFailed = true; 32 } 23 void TestResults::OnTestFailure ( TestDetails const& test, char const* failure ) { 24 ++m_failureCount; 25 if ( !m_currentTestFailed ) { 26 ++m_failedTestCount; 27 m_currentTestFailed = true; 28 } 33 29 34 if (m_testReporter)35 m_testReporter->ReportFailure(test, failure);30 if ( m_testReporter ) 31 m_testReporter->ReportFailure ( test, failure ); 36 32 } 37 33 38 void TestResults::OnTestFinish(TestDetails const& test, float secondsElapsed) 39 { 40 if (m_testReporter) 41 m_testReporter->ReportTestFinish(test, secondsElapsed); 34 void TestResults::OnTestFinish ( TestDetails const& test, float secondsElapsed ) { 35 if ( m_testReporter ) 36 m_testReporter->ReportTestFinish ( test, secondsElapsed ); 42 37 } 43 38 44 int TestResults::GetTotalTestCount() const 45 { 46 return m_totalTestCount; 39 int TestResults::GetTotalTestCount() const { 40 return m_totalTestCount; 47 41 } 48 42 49 int TestResults::GetFailedTestCount() const 50 { 51 return m_failedTestCount; 43 int TestResults::GetFailedTestCount() const { 44 return m_failedTestCount; 52 45 } 53 46 54 int TestResults::GetFailureCount() const 55 { 56 return m_failureCount; 47 int TestResults::GetFailureCount() const { 48 return m_failureCount; 57 49 } 58 50