MCPcopy Create free account
hub / github.com/apache/singa / GetTestCasePatternHolder

Method GetTestCasePatternHolder

test/gtest/gtest.h:10568–10597  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10566 // tests and instantiations of a particular test case.
10567 template <class TestCase>
10568 ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
10569 const char* test_case_name,
10570 const char* file,
10571 int line) {
10572 ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
10573 for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10574 it != test_case_infos_.end(); ++it) {
10575 if ((*it)->GetTestCaseName() == test_case_name) {
10576 if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
10577 // Complain about incorrect usage of Google Test facilities
10578 // and terminate the program since we cannot guaranty correct
10579 // test case setup and tear-down in this case.
10580 ReportInvalidTestCaseType(test_case_name, file, line);
10581 posix::Abort();
10582 } else {
10583 // At this point we are sure that the object we found is of the same
10584 // type we are looking for, so we downcast it to that type
10585 // without further checks.
10586 typed_test_info = CheckedDowncastToActualType<
10587 ParameterizedTestCaseInfo<TestCase> >(*it);
10588 }
10589 break;
10590 }
10591 }
10592 if (typed_test_info == NULL) {
10593 typed_test_info = new ParameterizedTestCaseInfo<TestCase>(test_case_name);
10594 test_case_infos_.push_back(typed_test_info);
10595 }
10596 return typed_test_info;
10597 }
10598 void RegisterTests() {
10599 for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10600 it != test_case_infos_.end(); ++it) {

Callers

nothing calls this directly

Calls 5

GetTestCaseTypeIdMethod · 0.80
AbortFunction · 0.70
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected