Fixed #3797: _ is a valid character in suppression IDs
This commit is contained in:
parent
5caab6ba10
commit
2c9545f603
|
@ -224,7 +224,7 @@ std::string Suppressions::addSuppression(const std::string &errorId, const std::
|
|||
}
|
||||
if (errorId != "*") {
|
||||
for (std::string::size_type pos = 0; pos < errorId.length(); ++pos) {
|
||||
if (errorId[pos] < 0 || !std::isalnum(errorId[pos])) {
|
||||
if (errorId[pos] < 0 || (!std::isalnum(errorId[pos]) && errorId[pos] != '_')) {
|
||||
return "Failed to add suppression. Invalid id \"" + errorId + "\"";
|
||||
}
|
||||
if (pos == 0 && std::isdigit(errorId[pos])) {
|
||||
|
|
|
@ -45,8 +45,11 @@ private:
|
|||
|
||||
void suppressionsBadId1() {
|
||||
Suppressions suppressions;
|
||||
std::istringstream s("123");
|
||||
ASSERT_EQUALS("Failed to add suppression. Invalid id \"123\"", suppressions.parseFile(s));
|
||||
std::istringstream s1("123");
|
||||
ASSERT_EQUALS("Failed to add suppression. Invalid id \"123\"", suppressions.parseFile(s1));
|
||||
|
||||
std::istringstream s2("obsoleteFunctionsrand_r");
|
||||
ASSERT_EQUALS("", suppressions.parseFile(s2));
|
||||
}
|
||||
|
||||
void suppressionsDosFormat() {
|
||||
|
|
Loading…
Reference in New Issue