mirror of
https://github.com/google/googletest.git
synced 2025-12-07 09:16:51 +08:00
Merge 7754b4042f6d08026617dea21a4d476872aacf2f into 1b96fa13f549387b7549cc89e1a785cf143a1a50
This commit is contained in:
commit
0cc9fe8beb
@ -653,14 +653,17 @@ class ParameterizedTestSuiteInfo : public ParameterizedTestSuiteInfoBase {
|
|||||||
int line;
|
int line;
|
||||||
};
|
};
|
||||||
typedef ::std::vector<InstantiationInfo> InstantiationContainer;
|
typedef ::std::vector<InstantiationInfo> InstantiationContainer;
|
||||||
|
|
||||||
static bool IsValidParamName(const std::string& name) {
|
static bool IsValidParamName(const std::string& name) {
|
||||||
|
static constexpr validParamChars = "_-:/";
|
||||||
|
|
||||||
// Check for empty string
|
// Check for empty string
|
||||||
if (name.empty()) return false;
|
if (name.empty()) return false;
|
||||||
|
|
||||||
// Check for invalid characters
|
// Check for invalid characters
|
||||||
for (std::string::size_type index = 0; index < name.size(); ++index) {
|
for (std::string::size_type index = 0; index < name.size(); ++index) {
|
||||||
if (!IsAlNum(name[index]) && name[index] != '_') return false;
|
if (!isalnum(name[index]) && validParamChars.find(name[index]) == std::string::npos)
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user