Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
testing::TestCase Class Reference

#include <gtest.h>

Public Member Functions

 TestCase (const char *name, const char *a_type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc)
 
virtual ~TestCase ()
 
const char * name () const
 
const char * type_param () const
 
bool should_run () const
 
int successful_test_count () const
 
int failed_test_count () const
 
int reportable_disabled_test_count () const
 
int disabled_test_count () const
 
int reportable_test_count () const
 
int test_to_run_count () const
 
int total_test_count () const
 
bool Passed () const
 
bool Failed () const
 
TimeInMillis elapsed_time () const
 
const TestInfoGetTestInfo (int i) const
 
const TestResultad_hoc_test_result () const
 

Friends

class Test
 
class internal::UnitTestImpl
 

Detailed Description

Definition at line 807 of file gtest.h.

Constructor & Destructor Documentation

◆ TestCase()

testing::TestCase::TestCase ( const char * name,
const char * a_type_param,
Test::SetUpTestCaseFunc set_up_tc,
Test::TearDownTestCaseFunc tear_down_tc )

Definition at line 2732 of file gtest.cc.

2735 : name_(a_name),
2736 type_param_(a_type_param ? new std::string(a_type_param) : NULL),
2737 set_up_tc_(set_up_tc),
2738 tear_down_tc_(tear_down_tc),
2739 should_run_(false),
2740 elapsed_time_(0) {
2741}

◆ ~TestCase()

testing::TestCase::~TestCase ( )
virtual

Definition at line 2744 of file gtest.cc.

2744 {
2745 // Deletes every Test in the collection.
2746 ForEach(test_info_list_, internal::Delete<TestInfo>);
2747}

Member Function Documentation

◆ ad_hoc_test_result()

const TestResult & testing::TestCase::ad_hoc_test_result ( ) const
inline

Definition at line 878 of file gtest.h.

878{ return ad_hoc_test_result_; }
Here is the caller graph for this function:

◆ disabled_test_count()

int testing::TestCase::disabled_test_count ( ) const

Definition at line 2704 of file gtest.cc.

2704 {
2705 return CountIf(test_info_list_, TestDisabled);
2706}
Here is the caller graph for this function:

◆ elapsed_time()

TimeInMillis testing::TestCase::elapsed_time ( ) const
inline

Definition at line 870 of file gtest.h.

870{ return elapsed_time_; }
Here is the caller graph for this function:

◆ Failed()

bool testing::TestCase::Failed ( ) const
inline

Definition at line 867 of file gtest.h.

867{ return failed_test_count() > 0; }
int failed_test_count() const
Definition gtest.cc:2694

◆ failed_test_count()

int testing::TestCase::failed_test_count ( ) const

Definition at line 2694 of file gtest.cc.

2694 {
2695 return CountIf(test_info_list_, TestFailed);
2696}
Here is the caller graph for this function:

◆ GetTestInfo()

const TestInfo * testing::TestCase::GetTestInfo ( int i) const

Definition at line 2751 of file gtest.cc.

2751 {
2752 const int index = GetElementOr(test_indices_, i, -1);
2753 return index < 0 ? NULL : test_info_list_[index];
2754}
Here is the caller graph for this function:

◆ name()

const char * testing::TestCase::name ( ) const
inline

Definition at line 829 of file gtest.h.

829{ return name_.c_str(); }
Here is the caller graph for this function:

◆ Passed()

bool testing::TestCase::Passed ( ) const
inline

Definition at line 864 of file gtest.h.

864{ return !Failed(); }
bool Failed() const
Definition gtest.h:867

◆ reportable_disabled_test_count()

int testing::TestCase::reportable_disabled_test_count ( ) const

Definition at line 2699 of file gtest.cc.

2699 {
2700 return CountIf(test_info_list_, TestReportableDisabled);
2701}
Here is the caller graph for this function:

◆ reportable_test_count()

int testing::TestCase::reportable_test_count ( ) const

Definition at line 2709 of file gtest.cc.

2709 {
2710 return CountIf(test_info_list_, TestReportable);
2711}
Here is the caller graph for this function:

◆ should_run()

bool testing::TestCase::should_run ( ) const
inline

Definition at line 840 of file gtest.h.

840{ return should_run_; }
Here is the caller graph for this function:

◆ successful_test_count()

int testing::TestCase::successful_test_count ( ) const

Definition at line 2689 of file gtest.cc.

2689 {
2690 return CountIf(test_info_list_, TestPassed);
2691}
Here is the caller graph for this function:

◆ test_to_run_count()

int testing::TestCase::test_to_run_count ( ) const

Definition at line 2714 of file gtest.cc.

2714 {
2715 return CountIf(test_info_list_, ShouldRunTest);
2716}
Here is the caller graph for this function:

◆ total_test_count()

int testing::TestCase::total_test_count ( ) const

Definition at line 2719 of file gtest.cc.

2719 {
2720 return static_cast<int>(test_info_list_.size());
2721}
Here is the caller graph for this function:

◆ type_param()

const char * testing::TestCase::type_param ( ) const
inline

Definition at line 833 of file gtest.h.

833 {
834 if (type_param_.get() != NULL)
835 return type_param_->c_str();
836 return NULL;
837 }
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ internal::UnitTestImpl

Definition at line 882 of file gtest.h.

◆ Test

friend class Test
friend

Definition at line 881 of file gtest.h.


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