39#if GTEST_HAS_TYPED_TEST_P
43static const char* SkipSpaces(
const char* str) {
49static std::vector<std::string> SplitIntoTestNames(
const char* src) {
50 std::vector<std::string> name_vec;
51 src = SkipSpaces(src);
52 for (; src != NULL; src = SkipComma(src)) {
61const char* TypedTestCasePState::VerifyRegisteredTestNames(
62 const char* file,
int line,
const char* registered_tests) {
63 typedef RegisteredTestsMap::const_iterator RegisteredTestIter;
66 std::vector<std::string> name_vec = SplitIntoTestNames(registered_tests);
70 std::set<std::string> tests;
71 for (std::vector<std::string>::const_iterator name_it = name_vec.begin();
72 name_it != name_vec.end(); ++name_it) {
73 const std::string&
name = *name_it;
74 if (tests.count(
name) != 0) {
75 errors <<
"Test " <<
name <<
" is listed more than once.\n";
80 for (RegisteredTestIter it = registered_tests_.begin();
81 it != registered_tests_.end();
83 if (
name == it->first) {
92 errors <<
"No test named " <<
name
93 <<
" can be found in this test case.\n";
97 for (RegisteredTestIter it = registered_tests_.begin();
98 it != registered_tests_.end();
100 if (tests.count(it->first) == 0) {
101 errors <<
"You forgot to list test " << it->first <<
".\n";
105 const std::string& errors_str = errors.GetString();
106 if (errors_str !=
"") {
113 return registered_tests;
GTEST_API_::std::string FormatFileLocation(const char *file, int line)
std::string StripTrailingSpaces(std::string str)