Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
testing::internal::ParameterizedTestCaseRegistry Class Reference

#include <gtest-param-util.h>

Public Member Functions

 ParameterizedTestCaseRegistry ()
 
 ~ParameterizedTestCaseRegistry ()
 
template<class TestCase >
ParameterizedTestCaseInfo< TestCase > * GetTestCasePatternHolder (const char *test_case_name, CodeLocation code_location)
 
void RegisterTests ()
 

Detailed Description

Definition at line 662 of file gtest-param-util.h.

Constructor & Destructor Documentation

◆ ParameterizedTestCaseRegistry()

testing::internal::ParameterizedTestCaseRegistry::ParameterizedTestCaseRegistry ( )
inline

Definition at line 664 of file gtest-param-util.h.

664{}

◆ ~ParameterizedTestCaseRegistry()

testing::internal::ParameterizedTestCaseRegistry::~ParameterizedTestCaseRegistry ( )
inline

Definition at line 665 of file gtest-param-util.h.

665 {
666 for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
667 it != test_case_infos_.end(); ++it) {
668 delete *it;
669 }
670 }

Member Function Documentation

◆ GetTestCasePatternHolder()

template<class TestCase >
ParameterizedTestCaseInfo< TestCase > * testing::internal::ParameterizedTestCaseRegistry::GetTestCasePatternHolder ( const char * test_case_name,
CodeLocation code_location )
inline

Definition at line 675 of file gtest-param-util.h.

677 {
678 ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
679 for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
680 it != test_case_infos_.end(); ++it) {
681 if ((*it)->GetTestCaseName() == test_case_name) {
682 if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
683 // Complain about incorrect usage of Google Test facilities
684 // and terminate the program since we cannot guaranty correct
685 // test case setup and tear-down in this case.
686 ReportInvalidTestCaseType(test_case_name, code_location);
687 posix::Abort();
688 } else {
689 // At this point we are sure that the object we found is of the same
690 // type we are looking for, so we downcast it to that type
691 // without further checks.
692 typed_test_info = CheckedDowncastToActualType<
693 ParameterizedTestCaseInfo<TestCase> >(*it);
694 }
695 break;
696 }
697 }
698 if (typed_test_info == NULL) {
699 typed_test_info = new ParameterizedTestCaseInfo<TestCase>(
700 test_case_name, code_location);
701 test_case_infos_.push_back(typed_test_info);
702 }
703 return typed_test_info;
704 }
GTEST_API_ void ReportInvalidTestCaseType(const char *test_case_name, CodeLocation code_location)
Definition gtest.cc:2578
Derived * CheckedDowncastToActualType(Base *base)
Here is the call graph for this function:

◆ RegisterTests()

void testing::internal::ParameterizedTestCaseRegistry::RegisterTests ( )
inline

Definition at line 705 of file gtest-param-util.h.

705 {
706 for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
707 it != test_case_infos_.end(); ++it) {
708 (*it)->RegisterTests();
709 }
710 }
Here is the caller graph for this function:

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