Refactors for the event listener API (by Vlad Losev): hides some methods in UnitTest; implements the result printers using the public API.

This commit is contained in:
zhanyong.wan
2009-06-25 20:49:23 +00:00
parent e6095deec8
commit aaebfcdc40
5 changed files with 139 additions and 138 deletions
+5 -4
View File
@@ -44,6 +44,8 @@
namespace testing {
using internal::GetUnitTestImpl;
// Gets the summary of the failure message by omitting the stack trace
// in it.
internal::String TestPartResult::ExtractSummary(const char* message) {
@@ -101,14 +103,13 @@ namespace internal {
HasNewFatalFailureHelper::HasNewFatalFailureHelper()
: has_new_fatal_failure_(false),
original_reporter_(UnitTest::GetInstance()->impl()->
original_reporter_(GetUnitTestImpl()->
GetTestPartResultReporterForCurrentThread()) {
UnitTest::GetInstance()->impl()->SetTestPartResultReporterForCurrentThread(
this);
GetUnitTestImpl()->SetTestPartResultReporterForCurrentThread(this);
}
HasNewFatalFailureHelper::~HasNewFatalFailureHelper() {
UnitTest::GetInstance()->impl()->SetTestPartResultReporterForCurrentThread(
GetUnitTestImpl()->SetTestPartResultReporterForCurrentThread(
original_reporter_);
}