Skip to content

Commit 0142689

Browse files
committed
Suppressions: fixed state update of existing suppression in addSuppression()
1 parent 40cc208 commit 0142689

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

lib/suppressions.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,9 @@ std::string SuppressionList::addSuppression(SuppressionList::Suppression suppres
250250
auto foundSuppression = std::find_if(mSuppressions.begin(), mSuppressions.end(),
251251
std::bind(&Suppression::isSameParameters, &suppression, std::placeholders::_1));
252252
if (foundSuppression != mSuppressions.end()) {
253-
// Update matched state of existing global suppression
254-
if (!suppression.isLocal() && suppression.matched)
253+
if (suppression.checked)
254+
foundSuppression->checked = suppression.checked;
255+
if (suppression.matched)
255256
foundSuppression->matched = suppression.matched;
256257
return "";
257258
}

test/testsuppressions.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -887,9 +887,8 @@ class TestSuppressions : public TestFixture {
887887
runChecks(&TestSuppressions::checkSuppressionFiles);
888888
}
889889

890-
static void suppressionsSettingsFS() {
891-
// TODO
892-
// runChecks(&TestSuppressions::checkSuppressionFS);
890+
void suppressionsSettingsFS() {
891+
runChecks(&TestSuppressions::checkSuppressionFS);
893892
}
894893

895894
void suppressionsSettingsThreadsFiles() {
@@ -1369,9 +1368,8 @@ class TestSuppressions : public TestFixture {
13691368
suppressingSyntaxErrorAndExitCodeInternal(&TestSuppressions::checkSuppressionFiles);
13701369
}
13711370

1372-
static void suppressingSyntaxErrorAndExitCodeFS() {
1373-
// TODO
1374-
// suppressingSyntaxErrorAndExitCodeInternal(&TestSuppressions::checkSuppressionFS);
1371+
void suppressingSyntaxErrorAndExitCodeFS() {
1372+
suppressingSyntaxErrorAndExitCodeInternal(&TestSuppressions::checkSuppressionFS);
13751373
}
13761374

13771375
void suppressingSyntaxErrorAndExitCodeMultiFileInternal(unsigned int (TestSuppressions::*check)(std::map<std::string, std::string> &f, const std::string &)) {
@@ -1387,9 +1385,8 @@ class TestSuppressions : public TestFixture {
13871385
suppressingSyntaxErrorAndExitCodeMultiFileInternal(&TestSuppressions::checkSuppressionFiles);
13881386
}
13891387

1390-
static void suppressingSyntaxErrorAndExitCodeMultiFileFS() {
1391-
// TODO
1392-
// suppressingSyntaxErrorAndExitCodeMultiFileInternal(&TestSuppressions::checkSuppressionFS);
1388+
void suppressingSyntaxErrorAndExitCodeMultiFileFS() {
1389+
suppressingSyntaxErrorAndExitCodeMultiFileInternal(&TestSuppressions::checkSuppressionFS);
13931390
}
13941391

13951392
void suppressLocal() const {

0 commit comments

Comments
 (0)