Strip trailing whitespace when stringifying type lists.
This commit is contained in:
@@ -612,7 +612,7 @@ class TypeParameterizedTest {
|
||||
MakeAndRegisterTestInfo(
|
||||
(std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/"
|
||||
+ StreamableToString(index)).c_str(),
|
||||
GetPrefixUntilComma(test_names).c_str(),
|
||||
StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(),
|
||||
GetTypeName<Type>().c_str(),
|
||||
NULL, // No value parameter.
|
||||
GetTypeId<FixtureClass>(),
|
||||
|
||||
@@ -2215,6 +2215,13 @@ inline char ToUpper(char ch) {
|
||||
return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
|
||||
}
|
||||
|
||||
inline std::string StripTrailingSpaces(std::string str) {
|
||||
std::string::iterator it = str.end();
|
||||
while (it != str.begin() && IsSpace(*--it))
|
||||
it = str.erase(it);
|
||||
return str;
|
||||
}
|
||||
|
||||
// The testing::internal::posix namespace holds wrappers for common
|
||||
// POSIX functions. These wrappers hide the differences between
|
||||
// Windows/MSVC and POSIX systems. Since some compilers define these
|
||||
|
||||
Reference in New Issue
Block a user