tesseract v5.3.3.20231005
testing::SetUpTestSuiteTest Class Reference
Inheritance diagram for testing::SetUpTestSuiteTest:
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 SetUpTestSuite ()
 
static void TearDownTestSuite ()
 

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 5504 of file gtest_unittest.cc.

Member Function Documentation

◆ SetUp()

void testing::SetUpTestSuiteTest::SetUp ( )
inlineoverrideprotectedvirtual

Reimplemented from testing::Test.

Definition at line 5539 of file gtest_unittest.cc.

5539 {
5540 // SetUpTestSuite() should be called only once, so counter_ should
5541 // always be 1.
5542 EXPECT_EQ(1, counter_);
5543 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:2043

◆ SetUpTestSuite()

static void testing::SetUpTestSuiteTest::SetUpTestSuite ( )
inlinestaticprotected

Definition at line 5508 of file gtest_unittest.cc.

5508 {
5509 printf("Setting up the test suite . . .\n");
5510
5511 // Initializes some shared resource. In this simple example, we
5512 // just create a C string. More complex stuff can be done if
5513 // desired.
5514 shared_resource_ = "123";
5515
5516 // Increments the number of test cases that have been set up.
5517 counter_++;
5518
5519 // SetUpTestSuite() should be called only once.
5520 EXPECT_EQ(1, counter_);
5521 }
static const char * shared_resource_

◆ TearDownTestSuite()

static void testing::SetUpTestSuiteTest::TearDownTestSuite ( )
inlinestaticprotected

Definition at line 5525 of file gtest_unittest.cc.

5525 {
5526 printf("Tearing down the test suite . . .\n");
5527
5528 // Decrements the number of test suites that have been set up.
5529 counter_--;
5530
5531 // TearDownTestSuite() should be called only once.
5532 EXPECT_EQ(0, counter_);
5533
5534 // Cleans up the shared resource.
5535 shared_resource_ = nullptr;
5536 }

Member Data Documentation

◆ counter_

int testing::SetUpTestSuiteTest::counter_ = 0
staticprotected

Definition at line 5546 of file gtest_unittest.cc.

◆ shared_resource_

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

Definition at line 5549 of file gtest_unittest.cc.


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