This commit is contained in:
Derek Brown 2020-03-26 01:12:40 -04:00 committed by GitHub
commit 9ee6d90319
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -642,6 +642,8 @@ class ParameterizedTestSuiteInfo : public ParameterizedTestSuiteInfoBase {
int line;
};
typedef ::std::vector<InstantiationInfo> InstantiationContainer;
static std::string validParamChars = "_-:/";
static bool IsValidParamName(const std::string& name) {
// Check for empty string
@ -650,7 +652,7 @@ class ParameterizedTestSuiteInfo : public ParameterizedTestSuiteInfoBase {
// Check for invalid characters
for (std::string::size_type index = 0; index < name.size(); ++index) {
if (!isalnum(name[index]) && name[index] != '_')
if (!isalnum(name[index]) && validParamChars.find(name[index]) == std::string::npos)
return false;
}