38 #if GTEST_HAS_TYPED_TEST_P 42 static const char* SkipSpaces(
const char*
str) {
48 static std::vector<std::string> SplitIntoTestNames(
const char* src) {
49 std::vector<std::string> name_vec;
50 src = SkipSpaces(src);
51 for (; src != NULL; src = SkipComma(src)) {
60 const char* TypedTestCasePState::VerifyRegisteredTestNames(
61 const char* file,
int line,
const char* registered_tests) {
62 typedef ::std::set<const char*>::const_iterator DefinedTestIter;
65 std::vector<std::string> name_vec = SplitIntoTestNames(registered_tests);
69 std::set<std::string>
tests;
70 for (std::vector<std::string>::const_iterator name_it = name_vec.begin();
71 name_it != name_vec.end(); ++name_it) {
73 if (tests.count(name) != 0) {
74 errors <<
"Test " << name <<
" is listed more than once.\n";
79 for (DefinedTestIter it = defined_test_names_.begin();
80 it != defined_test_names_.end();
91 errors <<
"No test named " << name
92 <<
" can be found in this test case.\n";
96 for (DefinedTestIter it = defined_test_names_.begin();
97 it != defined_test_names_.end();
99 if (tests.count(*it) == 0) {
100 errors <<
"You forgot to list test " << *it <<
".\n";
104 const std::string& errors_str = errors.GetString();
105 if (errors_str !=
"") {
112 return registered_tests;
115 #endif // GTEST_HAS_TYPED_TEST_P
GTEST_API_::std::string FormatFileLocation(const char *file, int line)
static const struct testcase tests[]
std::string StripTrailingSpaces(std::string str)