Skip to content

Commit 68accc6

Browse files
committed
Suppressions: fixed state update of existing suppression in addSuppression()
1 parent bfe28f8 commit 68accc6

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

lib/suppressions.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,9 @@ std::string Suppressions::addSuppression(Suppressions::Suppression suppression)
249249
auto foundSuppression = std::find_if(mSuppressions.begin(), mSuppressions.end(),
250250
std::bind(&Suppression::isSameParameters, &suppression, std::placeholders::_1));
251251
if (foundSuppression != mSuppressions.end()) {
252-
// Update matched state of existing global suppression
253-
if (!suppression.isLocal() && suppression.matched)
252+
if (suppression.checked)
253+
foundSuppression->checked = suppression.checked;
254+
if (suppression.matched)
254255
foundSuppression->matched = suppression.matched;
255256
return "";
256257
}

test/testsuppressions.cpp

+6-9
Original file line numberDiff line numberDiff line change
@@ -893,9 +893,8 @@ class TestSuppressions : public TestFixture {
893893
runChecks(&TestSuppressions::checkSuppressionFiles);
894894
}
895895

896-
static void suppressionsSettingsFS() {
897-
// TODO
898-
// runChecks(&TestSuppressions::checkSuppressionFS);
896+
void suppressionsSettingsFS() {
897+
runChecks(&TestSuppressions::checkSuppressionFS);
899898
}
900899

901900
void suppressionsSettingsThreadsFiles() {
@@ -1375,9 +1374,8 @@ class TestSuppressions : public TestFixture {
13751374
suppressingSyntaxErrorAndExitCodeInternal(&TestSuppressions::checkSuppressionFiles);
13761375
}
13771376

1378-
static void suppressingSyntaxErrorAndExitCodeFS() {
1379-
// TODO
1380-
// suppressingSyntaxErrorAndExitCodeInternal(&TestSuppressions::checkSuppressionFS);
1377+
void suppressingSyntaxErrorAndExitCodeFS() {
1378+
suppressingSyntaxErrorAndExitCodeInternal(&TestSuppressions::checkSuppressionFS);
13811379
}
13821380

13831381
void suppressingSyntaxErrorAndExitCodeMultiFileInternal(unsigned int (TestSuppressions::*check)(std::map<std::string, std::string> &f, const std::string &)) {
@@ -1393,9 +1391,8 @@ class TestSuppressions : public TestFixture {
13931391
suppressingSyntaxErrorAndExitCodeMultiFileInternal(&TestSuppressions::checkSuppressionFiles);
13941392
}
13951393

1396-
static void suppressingSyntaxErrorAndExitCodeMultiFileFS() {
1397-
// TODO
1398-
// suppressingSyntaxErrorAndExitCodeMultiFileInternal(&TestSuppressions::checkSuppressionFS);
1394+
void suppressingSyntaxErrorAndExitCodeMultiFileFS() {
1395+
suppressingSyntaxErrorAndExitCodeMultiFileInternal(&TestSuppressions::checkSuppressionFS);
13991396
}
14001397

14011398
void suppressLocal() const {

0 commit comments

Comments
 (0)