proxygen
testing::ScopedFakeTestPartResultReporter Class Reference

#include <gtest-spi.h>

Inheritance diagram for testing::ScopedFakeTestPartResultReporter:
testing::TestPartResultReporterInterface testing::TestPartResultReporterInterface testing::TestPartResultReporterInterface

Public Types

enum  InterceptMode {
  INTERCEPT_ONLY_CURRENT_THREAD, INTERCEPT_ALL_THREADS, INTERCEPT_ONLY_CURRENT_THREAD, INTERCEPT_ALL_THREADS,
  INTERCEPT_ONLY_CURRENT_THREAD, INTERCEPT_ALL_THREADS
}
 
enum  InterceptMode {
  INTERCEPT_ONLY_CURRENT_THREAD, INTERCEPT_ALL_THREADS, INTERCEPT_ONLY_CURRENT_THREAD, INTERCEPT_ALL_THREADS,
  INTERCEPT_ONLY_CURRENT_THREAD, INTERCEPT_ALL_THREADS
}
 
enum  InterceptMode {
  INTERCEPT_ONLY_CURRENT_THREAD, INTERCEPT_ALL_THREADS, INTERCEPT_ONLY_CURRENT_THREAD, INTERCEPT_ALL_THREADS,
  INTERCEPT_ONLY_CURRENT_THREAD, INTERCEPT_ALL_THREADS
}
 

Public Member Functions

 ScopedFakeTestPartResultReporter (TestPartResultArray *result)
 
 ScopedFakeTestPartResultReporter (InterceptMode intercept_mode, TestPartResultArray *result)
 
virtual ~ScopedFakeTestPartResultReporter ()
 
virtual void ReportTestPartResult (const TestPartResult &result)
 
 ScopedFakeTestPartResultReporter (TestPartResultArray *result)
 
 ScopedFakeTestPartResultReporter (InterceptMode intercept_mode, TestPartResultArray *result)
 
virtual ~ScopedFakeTestPartResultReporter ()
 
virtual void ReportTestPartResult (const TestPartResult &result)
 
 ScopedFakeTestPartResultReporter (TestPartResultArray *result)
 
 ScopedFakeTestPartResultReporter (InterceptMode intercept_mode, TestPartResultArray *result)
 
virtual ~ScopedFakeTestPartResultReporter ()
 
virtual void ReportTestPartResult (const TestPartResult &result)
 
- Public Member Functions inherited from testing::TestPartResultReporterInterface
virtual ~TestPartResultReporterInterface ()
 
virtual ~TestPartResultReporterInterface ()
 
virtual ~TestPartResultReporterInterface ()
 

Private Member Functions

void Init ()
 
 GTEST_DISALLOW_COPY_AND_ASSIGN_ (ScopedFakeTestPartResultReporter)
 
void Init ()
 
 GTEST_DISALLOW_COPY_AND_ASSIGN_ (ScopedFakeTestPartResultReporter)
 
void Init ()
 
 GTEST_DISALLOW_COPY_AND_ASSIGN_ (ScopedFakeTestPartResultReporter)
 

Private Attributes

const InterceptMode intercept_mode_
 
TestPartResultReporterInterfaceold_reporter_
 
TestPartResultArray *const result_
 

Detailed Description

Definition at line 51 of file gtest-spi.h.

Member Enumeration Documentation

Enumerator
INTERCEPT_ONLY_CURRENT_THREAD 
INTERCEPT_ALL_THREADS 
INTERCEPT_ONLY_CURRENT_THREAD 
INTERCEPT_ALL_THREADS 
INTERCEPT_ONLY_CURRENT_THREAD 
INTERCEPT_ALL_THREADS 

Definition at line 55 of file gtest-spi.h.

Enumerator
INTERCEPT_ONLY_CURRENT_THREAD 
INTERCEPT_ALL_THREADS 
INTERCEPT_ONLY_CURRENT_THREAD 
INTERCEPT_ALL_THREADS 
INTERCEPT_ONLY_CURRENT_THREAD 
INTERCEPT_ALL_THREADS 

Definition at line 55 of file gtest-spi.h.

Enumerator
INTERCEPT_ONLY_CURRENT_THREAD 
INTERCEPT_ALL_THREADS 
INTERCEPT_ONLY_CURRENT_THREAD 
INTERCEPT_ALL_THREADS 
INTERCEPT_ONLY_CURRENT_THREAD 
INTERCEPT_ALL_THREADS 

Definition at line 55 of file gtest-spi.h.

Constructor & Destructor Documentation

testing::ScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter ( TestPartResultArray result)
explicit
testing::ScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter ( InterceptMode  intercept_mode,
TestPartResultArray result 
)

Definition at line 573 of file gtest.cc.

References Init().

575  : intercept_mode_(intercept_mode),
576  result_(result) {
577  Init();
578 }
TestPartResultArray *const result_
Definition: gtest-spi.h:84
testing::ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter ( )
virtual

Definition at line 593 of file gtest.cc.

References testing::internal::GetUnitTestImpl(), INTERCEPT_ALL_THREADS, intercept_mode_, old_reporter_, testing::internal::UnitTestImpl::SetGlobalTestPartResultReporter(), and testing::internal::UnitTestImpl::SetTestPartResultReporterForCurrentThread().

Referenced by testing::internal::ShouldRunTestCase().

593  {
594  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
596  impl->SetGlobalTestPartResultReporter(old_reporter_);
597  } else {
598  impl->SetTestPartResultReporterForCurrentThread(old_reporter_);
599  }
600 }
class UnitTestImpl * GetUnitTestImpl()
TestPartResultReporterInterface * old_reporter_
Definition: gtest-spi.h:83
testing::ScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter ( TestPartResultArray result)
explicit
testing::ScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter ( InterceptMode  intercept_mode,
TestPartResultArray result 
)
virtual testing::ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter ( )
virtual
testing::ScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter ( TestPartResultArray result)
explicit
testing::ScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter ( InterceptMode  intercept_mode,
TestPartResultArray result 
)
virtual testing::ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter ( )
virtual

Member Function Documentation

testing::ScopedFakeTestPartResultReporter::GTEST_DISALLOW_COPY_AND_ASSIGN_ ( ScopedFakeTestPartResultReporter  )
private
testing::ScopedFakeTestPartResultReporter::GTEST_DISALLOW_COPY_AND_ASSIGN_ ( ScopedFakeTestPartResultReporter  )
private
testing::ScopedFakeTestPartResultReporter::GTEST_DISALLOW_COPY_AND_ASSIGN_ ( ScopedFakeTestPartResultReporter  )
private
void testing::ScopedFakeTestPartResultReporter::Init ( )
private
void testing::ScopedFakeTestPartResultReporter::Init ( )
private
void testing::ScopedFakeTestPartResultReporter::Init ( )
private

Definition at line 580 of file gtest.cc.

References testing::internal::UnitTestImpl::GetGlobalTestPartResultReporter(), testing::internal::UnitTestImpl::GetTestPartResultReporterForCurrentThread(), testing::internal::GetUnitTestImpl(), INTERCEPT_ALL_THREADS, intercept_mode_, old_reporter_, testing::internal::UnitTestImpl::SetGlobalTestPartResultReporter(), and testing::internal::UnitTestImpl::SetTestPartResultReporterForCurrentThread().

Referenced by ScopedFakeTestPartResultReporter(), and testing::internal::ShouldRunTestCase().

580  {
581  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
583  old_reporter_ = impl->GetGlobalTestPartResultReporter();
584  impl->SetGlobalTestPartResultReporter(this);
585  } else {
586  old_reporter_ = impl->GetTestPartResultReporterForCurrentThread();
587  impl->SetTestPartResultReporterForCurrentThread(this);
588  }
589 }
class UnitTestImpl * GetUnitTestImpl()
TestPartResultReporterInterface * old_reporter_
Definition: gtest-spi.h:83
virtual void testing::ScopedFakeTestPartResultReporter::ReportTestPartResult ( const TestPartResult result)
virtual
void testing::ScopedFakeTestPartResultReporter::ReportTestPartResult ( const TestPartResult result)
virtual

Implements testing::TestPartResultReporterInterface.

Definition at line 604 of file gtest.cc.

References testing::TestPartResultArray::Append(), and result_.

Referenced by testing::internal::ShouldRunTestCase().

605  {
606  result_->Append(result);
607 }
void Append(const TestPartResult &result)
TestPartResultArray *const result_
Definition: gtest-spi.h:84
virtual void testing::ScopedFakeTestPartResultReporter::ReportTestPartResult ( const TestPartResult result)
virtual

Member Data Documentation

const InterceptMode testing::ScopedFakeTestPartResultReporter::intercept_mode_
private

Definition at line 82 of file gtest-spi.h.

Referenced by Init(), and ~ScopedFakeTestPartResultReporter().

TestPartResultReporterInterface * testing::ScopedFakeTestPartResultReporter::old_reporter_
private

Definition at line 83 of file gtest-spi.h.

Referenced by Init(), and ~ScopedFakeTestPartResultReporter().

TestPartResultArray *const testing::ScopedFakeTestPartResultReporter::result_
private

Definition at line 84 of file gtest-spi.h.

Referenced by ReportTestPartResult().


The documentation for this class was generated from the following files: