Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
testing::SetUpTestCaseTest Class Reference
Inheritance diagram for testing::SetUpTestCaseTest:
Collaboration diagram for testing::SetUpTestCaseTest:

Protected Member Functions

virtual void SetUp ()
 
- Protected Member Functions inherited from testing::Test
 Test ()
 
virtual void TearDown ()
 

Static Protected Member Functions

static void SetUpTestCase ()
 
static void TearDownTestCase ()
 

Static Protected Attributes

static int counter_ = 0
 
static const char * shared_resource_ = NULL
 

Additional Inherited Members

- Public Types inherited from testing::Test
typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc
 
typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc
 
- Public Member Functions inherited from testing::Test
virtual ~Test ()
 
- Static Public Member Functions inherited from testing::Test
static void SetUpTestCase ()
 
static void TearDownTestCase ()
 
static bool HasFatalFailure ()
 
static bool HasNonfatalFailure ()
 
static bool HasFailure ()
 
static void RecordProperty (const std::string &key, const std::string &value)
 
static void RecordProperty (const std::string &key, int value)
 

Detailed Description

Definition at line 5425 of file gtest_unittest.cc.

Member Function Documentation

◆ SetUp()

virtual void testing::SetUpTestCaseTest::SetUp ( )
inlineprotectedvirtual

Reimplemented from testing::Test.

Definition at line 5460 of file gtest_unittest.cc.

5460 {
5461 // SetUpTestCase() should be called only once, so counter_ should
5462 // always be 1.
5463 EXPECT_EQ(1, counter_);
5464 }
#define EXPECT_EQ(val1, val2)
Definition gtest.h:1954

◆ SetUpTestCase()

static void testing::SetUpTestCaseTest::SetUpTestCase ( )
inlinestaticprotected

Definition at line 5429 of file gtest_unittest.cc.

5429 {
5430 printf("Setting up the test case . . .\n");
5431
5432 // Initializes some shared resource. In this simple example, we
5433 // just create a C string. More complex stuff can be done if
5434 // desired.
5435 shared_resource_ = "123";
5436
5437 // Increments the number of test cases that have been set up.
5438 counter_++;
5439
5440 // SetUpTestCase() should be called only once.
5441 EXPECT_EQ(1, counter_);
5442 }
static const char * shared_resource_
LOGGING_API void printf(Category category, const char *format,...)
Definition Logging.cpp:30

◆ TearDownTestCase()

static void testing::SetUpTestCaseTest::TearDownTestCase ( )
inlinestaticprotected

Definition at line 5446 of file gtest_unittest.cc.

5446 {
5447 printf("Tearing down the test case . . .\n");
5448
5449 // Decrements the number of test cases that have been set up.
5450 counter_--;
5451
5452 // TearDownTestCase() should be called only once.
5453 EXPECT_EQ(0, counter_);
5454
5455 // Cleans up the shared resource.
5456 shared_resource_ = NULL;
5457 }

Member Data Documentation

◆ counter_

int testing::SetUpTestCaseTest::counter_ = 0
staticprotected

Definition at line 5467 of file gtest_unittest.cc.

◆ shared_resource_

const char * testing::SetUpTestCaseTest::shared_resource_ = NULL
staticprotected

Definition at line 5470 of file gtest_unittest.cc.


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