Fixed #2797 (Inline suppressions do not handle filenames correctly)
This commit is contained in:
parent
cacca00080
commit
d76861270a
|
@ -17,6 +17,7 @@
|
|||
*/
|
||||
|
||||
#include "settings.h"
|
||||
#include "path.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
|
@ -224,7 +225,7 @@ std::string Settings::Suppressions::FileMatcher::addFile(const std::string &name
|
|||
}
|
||||
else
|
||||
{
|
||||
_files[name][line] = false;
|
||||
_files[Path::simplifyPath(name.c_str())][line] = false;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ private:
|
|||
TEST_CASE(suppressionsDosFormat); // Ticket #1836
|
||||
TEST_CASE(suppressionsFileNameWithColon); // Ticket #1919 - filename includes colon
|
||||
TEST_CASE(suppressionsGlob);
|
||||
TEST_CASE(suppressionsFileNameWithExtraPath);
|
||||
}
|
||||
|
||||
void suppressionsBadId1()
|
||||
|
@ -99,6 +100,14 @@ private:
|
|||
ASSERT_EQUALS(true, suppressions.isSuppressed("errorid", "abc.cpp", 2));
|
||||
}
|
||||
}
|
||||
|
||||
void suppressionsFileNameWithExtraPath()
|
||||
{
|
||||
// Ticket #2797
|
||||
Settings::Suppressions suppressions;
|
||||
suppressions.addSuppression("errorid", "./a.c", 123);
|
||||
ASSERT_EQUALS(true, suppressions.isSuppressed("errorid", "a.c", 123));
|
||||
}
|
||||
};
|
||||
|
||||
REGISTER_TEST(TestSettings)
|
||||
|
|
Loading…
Reference in New Issue