49 std::vector<std::string> name_vec;
51 for (; src !=
nullptr; src =
SkipComma(src)) {
60const char* TypedTestSuitePState::VerifyRegisteredTestNames(
61 const char* test_suite_name,
const char* file,
int line,
62 const char* registered_tests) {
65 typedef RegisteredTestsMap::const_iterator RegisteredTestIter;
72 std::set<std::string> tests;
73 for (std::vector<std::string>::const_iterator name_it = name_vec.begin();
74 name_it != name_vec.end(); ++name_it) {
75 const std::string& name = *name_it;
76 if (tests.count(name) != 0) {
77 errors <<
"Test " << name <<
" is listed more than once.\n";
81 if (registered_tests_.count(name) != 0) {
84 errors <<
"No test named " << name
85 <<
" can be found in this test suite.\n";
89 for (RegisteredTestIter it = registered_tests_.begin();
90 it != registered_tests_.end(); ++it) {
91 if (tests.count(it->first) == 0) {
92 errors <<
"You forgot to list test " << it->first <<
".\n";
96 const std::string& errors_str = errors.
GetString();
97 if (!errors_str.empty()) {
104 return registered_tests;
Definition gtest-message.h:101
std::string GetString() const
Definition gtest.cc:1301
void Abort()
Definition gtest-port.h:2147
GTEST_API_::std::string FormatFileLocation(const char *file, int line)
Definition gtest-port.cc:977
std::string GetPrefixUntilComma(const char *str)
Definition gtest-internal.h:649
GTEST_API_ void RegisterTypeParameterizedTestSuite(const char *test_suite_name, CodeLocation code_location)
Definition gtest.cc:557
std::string StripTrailingSpaces(std::string str)
Definition gtest-port.h:1975
static std::vector< std::string > SplitIntoTestNames(const char *src)
Definition gtest-typed-test.cc:48
const char * SkipComma(const char *str)
Definition gtest-internal.h:637
static const char * SkipSpaces(const char *str)
Definition gtest-typed-test.cc:43
bool IsSpace(char ch)
Definition gtest-port.h:1941
Definition gmock-actions.h:151