gtest-typed-test.cc (googletest-release-1.11.0) | : | gtest-typed-test.cc (googletest-release-1.12.0) | ||
---|---|---|---|---|
skipping to change at line 40 | skipping to change at line 40 | |||
#include "gtest/gtest-typed-test.h" | #include "gtest/gtest-typed-test.h" | |||
#include "gtest/gtest.h" | #include "gtest/gtest.h" | |||
namespace testing { | namespace testing { | |||
namespace internal { | namespace internal { | |||
// Skips to the first non-space char in str. Returns an empty string if str | // Skips to the first non-space char in str. Returns an empty string if str | |||
// contains only whitespace characters. | // contains only whitespace characters. | |||
static const char* SkipSpaces(const char* str) { | static const char* SkipSpaces(const char* str) { | |||
while (IsSpace(*str)) | while (IsSpace(*str)) str++; | |||
str++; | ||||
return str; | return str; | |||
} | } | |||
static std::vector<std::string> SplitIntoTestNames(const char* src) { | static std::vector<std::string> SplitIntoTestNames(const char* src) { | |||
std::vector<std::string> name_vec; | std::vector<std::string> name_vec; | |||
src = SkipSpaces(src); | src = SkipSpaces(src); | |||
for (; src != nullptr; src = SkipComma(src)) { | for (; src != nullptr; src = SkipComma(src)) { | |||
name_vec.push_back(StripTrailingSpaces(GetPrefixUntilComma(src))); | name_vec.push_back(StripTrailingSpaces(GetPrefixUntilComma(src))); | |||
} | } | |||
return name_vec; | return name_vec; | |||
skipping to change at line 87 | skipping to change at line 86 | |||
if (registered_tests_.count(name) != 0) { | if (registered_tests_.count(name) != 0) { | |||
tests.insert(name); | tests.insert(name); | |||
} else { | } else { | |||
errors << "No test named " << name | errors << "No test named " << name | |||
<< " can be found in this test suite.\n"; | << " can be found in this test suite.\n"; | |||
} | } | |||
} | } | |||
for (RegisteredTestIter it = registered_tests_.begin(); | for (RegisteredTestIter it = registered_tests_.begin(); | |||
it != registered_tests_.end(); | it != registered_tests_.end(); ++it) { | |||
++it) { | ||||
if (tests.count(it->first) == 0) { | if (tests.count(it->first) == 0) { | |||
errors << "You forgot to list test " << it->first << ".\n"; | errors << "You forgot to list test " << it->first << ".\n"; | |||
} | } | |||
} | } | |||
const std::string& errors_str = errors.GetString(); | const std::string& errors_str = errors.GetString(); | |||
if (errors_str != "") { | if (errors_str != "") { | |||
fprintf(stderr, "%s %s", FormatFileLocation(file, line).c_str(), | fprintf(stderr, "%s %s", FormatFileLocation(file, line).c_str(), | |||
errors_str.c_str()); | errors_str.c_str()); | |||
fflush(stderr); | fflush(stderr); | |||
End of changes. 2 change blocks. | ||||
4 lines changed or deleted | 2 lines changed or added |