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
  • Loading branch information
swasti16 committed Aug 16, 2024
1 parent 4f41804 commit d586569
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 d586569

Please sign in to comment.