tesseract v5.3.3.20231005
testing::internal::ParameterizedTestSuiteRegistry Class Reference

#include <gtest-param-util.h>

Public Member Functions

 ParameterizedTestSuiteRegistry ()
 
 ~ParameterizedTestSuiteRegistry ()
 
template<class TestSuite >
ParameterizedTestSuiteInfo< TestSuite > * GetTestSuitePatternHolder (const char *test_suite_name, CodeLocation code_location)
 
void RegisterTests ()
 
template<class TestCase >
ParameterizedTestCaseInfo< TestCase > * GetTestCasePatternHolder (const char *test_case_name, CodeLocation code_location)
 

Detailed Description

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

Constructor & Destructor Documentation

◆ ParameterizedTestSuiteRegistry()

testing::internal::ParameterizedTestSuiteRegistry::ParameterizedTestSuiteRegistry ( )
inline

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

686{}

◆ ~ParameterizedTestSuiteRegistry()

testing::internal::ParameterizedTestSuiteRegistry::~ParameterizedTestSuiteRegistry ( )
inline

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

687 {
688 for (auto& test_suite_info : test_suite_infos_) {
689 delete test_suite_info;
690 }
691 }

Member Function Documentation

◆ GetTestCasePatternHolder()

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

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

733 {
734 return GetTestSuitePatternHolder<TestCase>(test_case_name, code_location);
735 }

◆ GetTestSuitePatternHolder()

template<class TestSuite >
ParameterizedTestSuiteInfo< TestSuite > * testing::internal::ParameterizedTestSuiteRegistry::GetTestSuitePatternHolder ( const char *  test_suite_name,
CodeLocation  code_location 
)
inline

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

697 {
698 ParameterizedTestSuiteInfo<TestSuite>* typed_test_info = nullptr;
699 for (auto& test_suite_info : test_suite_infos_) {
700 if (test_suite_info->GetTestSuiteName() == test_suite_name) {
701 if (test_suite_info->GetTestSuiteTypeId() != GetTypeId<TestSuite>()) {
702 // Complain about incorrect usage of Google Test facilities
703 // and terminate the program since we cannot guaranty correct
704 // test suite setup and tear-down in this case.
705 ReportInvalidTestSuiteType(test_suite_name, code_location);
706 posix::Abort();
707 } else {
708 // At this point we are sure that the object we found is of the same
709 // type we are looking for, so we downcast it to that type
710 // without further checks.
711 typed_test_info = CheckedDowncastToActualType<
712 ParameterizedTestSuiteInfo<TestSuite> >(test_suite_info);
713 }
714 break;
715 }
716 }
717 if (typed_test_info == nullptr) {
718 typed_test_info = new ParameterizedTestSuiteInfo<TestSuite>(
719 test_suite_name, code_location);
720 test_suite_infos_.push_back(typed_test_info);
721 }
722 return typed_test_info;
723 }
GTEST_API_ void ReportInvalidTestSuiteType(const char *test_suite_name, CodeLocation code_location)
Definition: gtest.cc:2768
Derived * CheckedDowncastToActualType(Base *base)
Definition: gtest-port.h:1116

◆ RegisterTests()

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

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

724 {
725 for (auto& test_suite_info : test_suite_infos_) {
726 test_suite_info->RegisterTests();
727 }
728 }

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