Skip to content

Commit

Permalink
Fix #13012: Duplicated misra warnings from misra.py and premiumaddon …
Browse files Browse the repository at this point in the history
…are not filtered properly in windows (#6703)
  • Loading branch information
swasti16 authored Aug 16, 2024
1 parent dad65bf commit 1b7dd3a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,8 @@ void Settings::setMisraRuleTexts(const std::string& data)
std::string text = line.substr(pos + 1);
if (id.empty() || text.empty())
continue;
if (text[text.size() -1] == '\r')
text.erase(text.size() -1);
mMisraRuleTexts[id] = std::move(text);
}
}
Expand Down
3 changes: 2 additions & 1 deletion test/testsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,10 @@ class TestSettings : public TestFixture {
void ruleTexts() const
{
Settings s;
s.setMisraRuleTexts("1.1 text 1\n1.2 text 2\n");
s.setMisraRuleTexts("1.1 text 1\n1.2 text 2\n1.3 text 3\r\n");
ASSERT_EQUALS("text 1", s.getMisraRuleText("misra-c2012-1.1", "---"));
ASSERT_EQUALS("text 2", s.getMisraRuleText("misra-c2012-1.2", "---"));
ASSERT_EQUALS("text 3", s.getMisraRuleText("misra-c2012-1.3", "---"));
}

void checkLevelDefault() const
Expand Down

0 comments on commit 1b7dd3a

Please sign in to comment.