Fixed #7455 (Suppressions: not working well with windows path separators)
This commit is contained in:
parent
9ea9ae6b87
commit
37afc57a2a
|
@ -198,7 +198,7 @@ bool Suppressions::FileMatcher::isSuppressed(const std::string &file, unsigned i
|
||||||
|
|
||||||
bool Suppressions::FileMatcher::isSuppressedLocal(const std::string &file, unsigned int line)
|
bool Suppressions::FileMatcher::isSuppressedLocal(const std::string &file, unsigned int line)
|
||||||
{
|
{
|
||||||
std::map<std::string, std::map<unsigned int, bool> >::iterator f = _files.find(file);
|
std::map<std::string, std::map<unsigned int, bool> >::iterator f = _files.find(Path::fromNativeSeparators(file));
|
||||||
if (f != _files.end()) {
|
if (f != _files.end()) {
|
||||||
std::map<unsigned int, bool>::iterator l = f->second.find(0U);
|
std::map<unsigned int, bool>::iterator l = f->second.find(0U);
|
||||||
if (l != f->second.end()) {
|
if (l != f->second.end()) {
|
||||||
|
@ -268,7 +268,7 @@ std::list<Suppressions::SuppressionEntry> Suppressions::getUnmatchedLocalSuppres
|
||||||
if (!unusedFunctionChecking && i->first == "unusedFunction")
|
if (!unusedFunctionChecking && i->first == "unusedFunction")
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
std::map<std::string, std::map<unsigned int, bool> >::const_iterator f = i->second._files.find(file);
|
std::map<std::string, std::map<unsigned int, bool> >::const_iterator f = i->second._files.find(Path::fromNativeSeparators(file));
|
||||||
if (f != i->second._files.end()) {
|
if (f != i->second._files.end()) {
|
||||||
for (std::map<unsigned int, bool>::const_iterator l = f->second.begin(); l != f->second.end(); ++l) {
|
for (std::map<unsigned int, bool>::const_iterator l = f->second.begin(); l != f->second.end(); ++l) {
|
||||||
if (!l->second) {
|
if (!l->second) {
|
||||||
|
|
|
@ -345,6 +345,9 @@ private:
|
||||||
Suppressions suppressions;
|
Suppressions suppressions;
|
||||||
suppressions.addSuppressionLine("*:test\\*");
|
suppressions.addSuppressionLine("*:test\\*");
|
||||||
ASSERT_EQUALS(true, suppressions.isSuppressed("someid", "test/foo/bar.cpp", 142));
|
ASSERT_EQUALS(true, suppressions.isSuppressed("someid", "test/foo/bar.cpp", 142));
|
||||||
|
|
||||||
|
suppressions.addSuppressionLine("abc:include/1.h");
|
||||||
|
ASSERT_EQUALS(true, suppressions.isSuppressed("abc", "include\\1.h", 142));
|
||||||
}
|
}
|
||||||
|
|
||||||
void inlinesuppress_unusedFunction() const { // #4210, #4946 - wrong report of "unmatchedSuppression" for "unusedFunction"
|
void inlinesuppress_unusedFunction() const { // #4210, #4946 - wrong report of "unmatchedSuppression" for "unusedFunction"
|
||||||
|
|
Loading…
Reference in New Issue