本文整理汇总了C++中Suppressions::isSuppressed方法的典型用法代码示例。如果您正苦于以下问题:C++ Suppressions::isSuppressed方法的具体用法?C++ Suppressions::isSuppressed怎么用?C++ Suppressions::isSuppressed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Suppressions
的用法示例。
在下文中一共展示了Suppressions::isSuppressed方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: suppressionsFileNameWithColon
void suppressionsFileNameWithColon() const {
Suppressions suppressions;
std::istringstream s("errorid:c:\\foo.cpp\nerrorid:c:\\bar.cpp:12");
ASSERT_EQUALS("", suppressions.parseFile(s));
ASSERT_EQUALS(true, suppressions.isSuppressed("errorid", "c:/foo.cpp", 1111));
ASSERT_EQUALS(false, suppressions.isSuppressed("errorid", "c:/bar.cpp", 10));
ASSERT_EQUALS(true, suppressions.isSuppressed("errorid", "c:/bar.cpp", 12));
}
示例2: suppressionsPathSeparator
void suppressionsPathSeparator() const {
Suppressions suppressions;
suppressions.addSuppressionLine("*:test\\*");
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));
}
示例3: suppressionsGlob
void suppressionsGlob() const {
// Check for syntax errors in glob
{
Suppressions suppressions;
std::istringstream s("errorid:**.cpp\n");
ASSERT_EQUALS("Failed to add suppression. Syntax error in glob.", suppressions.parseFile(s));
}
// Check that globbing works
{
Suppressions suppressions;
std::istringstream s("errorid:x*.cpp\nerrorid:y?.cpp\nerrorid:test.c*");
ASSERT_EQUALS("", suppressions.parseFile(s));
ASSERT_EQUALS(true, suppressions.isSuppressed("errorid", "xyz.cpp", 1));
ASSERT_EQUALS(true, suppressions.isSuppressed("errorid", "xyz.cpp.cpp", 1));
ASSERT_EQUALS(false, suppressions.isSuppressed("errorid", "abc.cpp", 1));
ASSERT_EQUALS(true, suppressions.isSuppressed("errorid", "ya.cpp", 1));
ASSERT_EQUALS(false, suppressions.isSuppressed("errorid", "y.cpp", 1));
ASSERT_EQUALS(true, suppressions.isSuppressed("errorid", "test.c", 1));
ASSERT_EQUALS(true, suppressions.isSuppressed("errorid", "test.cpp", 1));
}
// Check that both a filename match and a glob match apply
{
Suppressions suppressions;
std::istringstream s("errorid:x*.cpp\nerrorid:xyz.cpp:1\nerrorid:a*.cpp:1\nerrorid:abc.cpp:2");
ASSERT_EQUALS("", suppressions.parseFile(s));
ASSERT_EQUALS(true, suppressions.isSuppressed("errorid", "xyz.cpp", 1));
ASSERT_EQUALS(true, suppressions.isSuppressed("errorid", "xyz.cpp", 2));
ASSERT_EQUALS(true, suppressions.isSuppressed("errorid", "abc.cpp", 1));
ASSERT_EQUALS(true, suppressions.isSuppressed("errorid", "abc.cpp", 2));
}
}
示例4: suppressionsDosFormat
void suppressionsDosFormat() const {
Suppressions suppressions;
std::istringstream s("abc\r\ndef\r\n");
ASSERT_EQUALS("", suppressions.parseFile(s));
ASSERT_EQUALS(true, suppressions.isSuppressed("abc", "test.cpp", 1));
ASSERT_EQUALS(true, suppressions.isSuppressed("def", "test.cpp", 1));
}
示例5: suppressionsFileNameWithExtraPath
void suppressionsFileNameWithExtraPath() const {
// Ticket #2797
Suppressions suppressions;
suppressions.addSuppression("errorid", "./a.c", 123);
ASSERT_EQUALS(true, suppressions.isSuppressed("errorid", "a.c", 123));
}