tesseract v5.3.3.20231005
testing::SetUpTestCaseTest Class Reference
Inheritance diagram for testing::SetUpTestCaseTest:
testing::Test

Protected Member Functions

void SetUp () override
 
- Protected Member Functions inherited from testing::Test
 Test ()
 
virtual void SetUp ()
 
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_ = nullptr
 

Additional Inherited Members

- Public Member Functions inherited from testing::Test
virtual ~Test ()
 
- Static Public Member Functions inherited from testing::Test
static void SetUpTestSuite ()
 
static void TearDownTestSuite ()
 
static void TearDownTestCase ()
 
static void SetUpTestCase ()
 
static bool HasFatalFailure ()
 
static bool HasNonfatalFailure ()
 
static bool IsSkipped ()
 
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 5443 of file gtest_unittest.cc.

Member Function Documentation

◆ SetUp()

void testing::SetUpTestCaseTest::SetUp ( )
inlineoverrideprotectedvirtual

Reimplemented from testing::Test.

Definition at line 5478 of file gtest_unittest.cc.

5478 {
5479 // SetUpTestCase() should be called only once, so counter_ should
5480 // always be 1.
5481 EXPECT_EQ(1, counter_);
5482 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:2043

◆ SetUpTestCase()

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

Definition at line 5447 of file gtest_unittest.cc.

5447 {
5448 printf("Setting up the test case . . .\n");
5449
5450 // Initializes some shared resource. In this simple example, we
5451 // just create a C string. More complex stuff can be done if
5452 // desired.
5453 shared_resource_ = "123";
5454
5455 // Increments the number of test cases that have been set up.
5456 counter_++;
5457
5458 // SetUpTestCase() should be called only once.
5459 EXPECT_EQ(1, counter_);
5460 }
static const char * shared_resource_

◆ TearDownTestCase()

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

Definition at line 5464 of file gtest_unittest.cc.

5464 {
5465 printf("Tearing down the test case . . .\n");
5466
5467 // Decrements the number of test cases that have been set up.
5468 counter_--;
5469
5470 // TearDownTestCase() should be called only once.
5471 EXPECT_EQ(0, counter_);
5472
5473 // Cleans up the shared resource.
5474 shared_resource_ = nullptr;
5475 }

Member Data Documentation

◆ counter_

int testing::SetUpTestCaseTest::counter_ = 0
staticprotected

Definition at line 5485 of file gtest_unittest.cc.

◆ shared_resource_

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

Definition at line 5488 of file gtest_unittest.cc.


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