Fix unmatched local suppression error message for "unusedFunction" (#6228)

This fixes a regression from commit
e35329aba3
(fix for #4946)
This commit is contained in:
Thomas Jarosch 2015-01-07 15:34:01 +01:00
parent 4c2e42a52c
commit 2cb2161c5d
2 changed files with 2 additions and 2 deletions

View File

@ -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);

View 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());