Skip to content

Commit 9606dd6

Browse files
committed
Suppressions: fixed state update of existing suppression in addSuppression() [skip ci]
1 parent b2e0b3b commit 9606dd6

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

Diff for: 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
}

Diff for: test/testsuppressions.cpp

+6-9
Original file line numberDiff line numberDiff line change
@@ -886,9 +886,8 @@ class TestSuppressions : public TestFixture {
886886
runChecks(&TestSuppressions::checkSuppressionFiles);
887887
}
888888

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

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

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

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

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

13941391
void suppressLocal() const {

0 commit comments

Comments
 (0)