Xmipp  v3.23.11-Nereus
Public Member Functions | List of all members
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 692 of file gtest-param-util.h.

Constructor & Destructor Documentation

◆ ParameterizedTestSuiteRegistry()

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

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

694 {}

◆ ~ParameterizedTestSuiteRegistry()

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

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

695  {
696  for (auto& test_suite_info : test_suite_infos_) {
697  delete test_suite_info;
698  }
699  }

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 740 of file gtest-param-util.h.

741  {
742  return GetTestSuitePatternHolder<TestCase>(test_case_name, code_location);
743  }

◆ GetTestSuitePatternHolder()

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

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

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

◆ RegisterTests()

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

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

732  {
733  for (auto& test_suite_info : test_suite_infos_) {
734  test_suite_info->RegisterTests();
735  }
736  }

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