tesseract v5.3.3.20231005
TestGenerationTest Class Reference
Inheritance diagram for TestGenerationTest:
testing::TestWithParam< int > testing::Test testing::WithParamInterface< int >

Public Types

enum  { PARAMETER_COUNT }
 
typedef TestGenerationEnvironment< PARAMETER_COUNTEnvironment
 
- Public Types inherited from testing::WithParamInterface< int >
typedef int ParamType
 

Public Member Functions

 TestGenerationTest ()
 
void SetUp () override
 
void TearDown () override
 
- Public Member Functions inherited from testing::Test
virtual ~Test ()
 
- Public Member Functions inherited from testing::WithParamInterface< int >
virtual ~WithParamInterface ()
 

Static Public Member Functions

static void SetUpTestSuite ()
 
static void TearDownTestSuite ()
 
- 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)
 
- Static Public Member Functions inherited from testing::WithParamInterface< int >
static const ParamTypeGetParam ()
 

Protected Attributes

int current_parameter_
 

Static Protected Attributes

static vector< int > collected_parameters_
 

Additional Inherited Members

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

Detailed Description

Definition at line 611 of file googletest-param-test-test.cc.

Member Typedef Documentation

◆ Environment

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
PARAMETER_COUNT 

Definition at line 613 of file googletest-param-test-test.cc.

613 {
616 };
const int test_generation_params[]

Constructor & Destructor Documentation

◆ TestGenerationTest()

TestGenerationTest::TestGenerationTest ( )
inline

Member Function Documentation

◆ SetUp()

void TestGenerationTest::SetUp ( )
inlineoverridevirtual

Reimplemented from testing::Test.

Definition at line 624 of file googletest-param-test-test.cc.

624 {
627 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:2043

◆ SetUpTestSuite()

static void TestGenerationTest::SetUpTestSuite ( )
inlinestatic

Definition at line 633 of file googletest-param-test-test.cc.

633 {
634 bool all_tests_in_test_case_selected = true;
635
636 for (int i = 0; i < PARAMETER_COUNT; ++i) {
637 Message test_name;
638 test_name << "TestsExpandedAndRun/" << i;
639 if ( !UnitTestOptions::FilterMatchesTest(
640 "TestExpansionModule/MultipleTestGenerationTest",
641 test_name.GetString())) {
642 all_tests_in_test_case_selected = false;
643 }
644 }
645 EXPECT_TRUE(all_tests_in_test_case_selected)
646 << "When running the TestGenerationTest test case all of its tests\n"
647 << "must be selected by the filter flag for the test case to pass.\n"
648 << "If not all of them are enabled, we can't reliably conclude\n"
649 << "that the correct number of tests have been generated.";
650
651 collected_parameters_.clear();
652 }
#define EXPECT_TRUE(condition)
Definition: gtest.h:1982
static vector< int > collected_parameters_

◆ TearDown()

void TestGenerationTest::TearDown ( )
inlineoverridevirtual

◆ TearDownTestSuite()

static void TestGenerationTest::TearDownTestSuite ( )
inlinestatic

Definition at line 654 of file googletest-param-test-test.cc.

654 {
655 vector<int> expected_values(test_generation_params,
657 // Test execution order is not guaranteed by Google Test,
658 // so the order of values in collected_parameters_ can be
659 // different and we have to sort to compare.
660 sort(expected_values.begin(), expected_values.end());
661 sort(collected_parameters_.begin(), collected_parameters_.end());
662
663 EXPECT_TRUE(collected_parameters_ == expected_values);
664 }

Member Data Documentation

◆ collected_parameters_

vector< int > TestGenerationTest::collected_parameters_
staticprotected

Definition at line 668 of file googletest-param-test-test.cc.

◆ current_parameter_

int TestGenerationTest::current_parameter_
protected

Definition at line 667 of file googletest-param-test-test.cc.


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