Fix unmatched local suppression error message for "unusedFunction" (#6228)
This fixes a regression from commit
e35329aba3
(fix for #4946)
This commit is contained in:
parent
4c2e42a52c
commit
2cb2161c5d
|
@ -269,7 +269,7 @@ std::list<Suppressions::SuppressionEntry> Suppressions::getUnmatchedLocalSuppres
|
|||
{
|
||||
std::list<SuppressionEntry> r;
|
||||
for (std::map<std::string, FileMatcher>::const_iterator i = _suppressions.begin(); i != _suppressions.end(); ++i) {
|
||||
if (!unusedFunctionChecking && i->first == "unusedFunction")
|
||||
if (i->first == "unusedFunction")
|
||||
continue; // unusedFunction is not a "local" suppression
|
||||
|
||||
std::map<std::string, std::map<unsigned int, bool> >::const_iterator f = i->second._files.find(file);
|
||||
|
|
|
@ -327,7 +327,7 @@ private:
|
|||
void inlinesuppress_unusedFunction() const { // #4210, #4946 - wrong report of "unmatchedSuppression" for "unusedFunction"
|
||||
Suppressions suppressions;
|
||||
suppressions.addSuppression("unusedFunction", "test.c", 3U);
|
||||
ASSERT_EQUALS(true, !suppressions.getUnmatchedLocalSuppressions("test.c", true).empty());
|
||||
ASSERT_EQUALS(false, !suppressions.getUnmatchedLocalSuppressions("test.c", true).empty());
|
||||
ASSERT_EQUALS(false, !suppressions.getUnmatchedGlobalSuppressions(true).empty());
|
||||
ASSERT_EQUALS(false, !suppressions.getUnmatchedLocalSuppressions("test.c", false).empty());
|
||||
ASSERT_EQUALS(false, !suppressions.getUnmatchedGlobalSuppressions(false).empty());
|
||||
|
|
Loading…
Reference in New Issue