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

Public Types

enum  { PARAMETER_COUNT }
 
typedef TestGenerationEnvironment< PARAMETER_COUNTEnvironment
 

Public Member Functions

 TestGenerationTest ()
 
virtual void SetUp ()
 
virtual void TearDown ()
 

Static Public Member Functions

static void SetUpTestCase ()
 
static void TearDownTestCase ()
 

Protected Attributes

int current_parameter_
 

Static Protected Attributes

static vector< int > collected_parameters_
 

Detailed Description

Definition at line 663 of file gtest-param-test_test.cc.

Member Typedef Documentation

◆ Environment

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
PARAMETER_COUNT 

Definition at line 665 of file gtest-param-test_test.cc.

665 {
668 };
const int test_generation_params[]

Constructor & Destructor Documentation

◆ TestGenerationTest()

TestGenerationTest::TestGenerationTest ( )
inline

Definition at line 672 of file gtest-param-test_test.cc.

Here is the call graph for this function:

Member Function Documentation

◆ SetUp()

virtual void TestGenerationTest::SetUp ( )
inlinevirtual

Definition at line 676 of file gtest-param-test_test.cc.

676 {
678 EXPECT_EQ(current_parameter_, GetParam());
679 }
#define EXPECT_EQ(val1, val2)
Definition gtest.h:1954
Here is the call graph for this function:

◆ SetUpTestCase()

static void TestGenerationTest::SetUpTestCase ( )
inlinestatic

Definition at line 685 of file gtest-param-test_test.cc.

685 {
686 bool all_tests_in_test_case_selected = true;
687
688 for (int i = 0; i < PARAMETER_COUNT; ++i) {
689 Message test_name;
690 test_name << "TestsExpandedAndRun/" << i;
691 if ( !UnitTestOptions::FilterMatchesTest(
692 "TestExpansionModule/MultipleTestGenerationTest",
693 test_name.GetString())) {
694 all_tests_in_test_case_selected = false;
695 }
696 }
697 EXPECT_TRUE(all_tests_in_test_case_selected)
698 << "When running the TestGenerationTest test case all of its tests\n"
699 << "must be selected by the filter flag for the test case to pass.\n"
700 << "If not all of them are enabled, we can't reliably conclude\n"
701 << "that the correct number of tests have been generated.";
702
703 collected_parameters_.clear();
704 }
static vector< int > collected_parameters_
#define EXPECT_TRUE(condition)
Definition gtest.h:1895

◆ TearDown()

virtual void TestGenerationTest::TearDown ( )
inlinevirtual

Definition at line 680 of file gtest-param-test_test.cc.

Here is the call graph for this function:

◆ TearDownTestCase()

static void TestGenerationTest::TearDownTestCase ( )
inlinestatic

Definition at line 706 of file gtest-param-test_test.cc.

706 {
707 vector<int> expected_values(test_generation_params,
709 // Test execution order is not guaranteed by Google Test,
710 // so the order of values in collected_parameters_ can be
711 // different and we have to sort to compare.
712 sort(expected_values.begin(), expected_values.end());
713 sort(collected_parameters_.begin(), collected_parameters_.end());
714
715 EXPECT_TRUE(collected_parameters_ == expected_values);
716 }

Member Data Documentation

◆ collected_parameters_

vector< int > TestGenerationTest::collected_parameters_
staticprotected

Definition at line 720 of file gtest-param-test_test.cc.

◆ current_parameter_

int TestGenerationTest::current_parameter_
protected

Definition at line 719 of file gtest-param-test_test.cc.


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