Address some warnings on test code
This commit is contained in:
parent
a8e12a6f29
commit
6db9c78fb6
|
@ -927,34 +927,35 @@ private:
|
|||
ASSERT_EQUALS(0, parser.GetIgnoredPaths().size());
|
||||
}
|
||||
|
||||
void ignorepaths1() {
|
||||
REDIRECT;
|
||||
const char *argv[] = {"cppcheck", "-isrc", "file.cpp"};
|
||||
CmdLineParser parser(&settings);
|
||||
ASSERT(parser.ParseFromArgs(3, argv));
|
||||
ASSERT_EQUALS(1, parser.GetIgnoredPaths().size());
|
||||
ASSERT_EQUALS("src/", parser.GetIgnoredPaths()[0]);
|
||||
}
|
||||
/*
|
||||
void ignorepaths1() {
|
||||
REDIRECT;
|
||||
const char *argv[] = {"cppcheck", "-isrc", "file.cpp"};
|
||||
CmdLineParser parser(&settings);
|
||||
ASSERT(parser.ParseFromArgs(3, argv));
|
||||
ASSERT_EQUALS(1, parser.GetIgnoredPaths().size());
|
||||
ASSERT_EQUALS("src/", parser.GetIgnoredPaths()[0]);
|
||||
}
|
||||
|
||||
void ignorepaths2() {
|
||||
REDIRECT;
|
||||
const char *argv[] = {"cppcheck", "-i", "src", "file.cpp"};
|
||||
CmdLineParser parser(&settings);
|
||||
ASSERT(parser.ParseFromArgs(4, argv));
|
||||
ASSERT_EQUALS(1, parser.GetIgnoredPaths().size());
|
||||
ASSERT_EQUALS("src/", parser.GetIgnoredPaths()[0]);
|
||||
}
|
||||
|
||||
void ignorepaths3() {
|
||||
REDIRECT;
|
||||
const char *argv[] = {"cppcheck", "-isrc", "-imodule", "file.cpp"};
|
||||
CmdLineParser parser(&settings);
|
||||
ASSERT(parser.ParseFromArgs(4, argv));
|
||||
ASSERT_EQUALS(2, parser.GetIgnoredPaths().size());
|
||||
ASSERT_EQUALS("src/", parser.GetIgnoredPaths()[0]);
|
||||
ASSERT_EQUALS("module/", parser.GetIgnoredPaths()[1]);
|
||||
}
|
||||
void ignorepaths2() {
|
||||
REDIRECT;
|
||||
const char *argv[] = {"cppcheck", "-i", "src", "file.cpp"};
|
||||
CmdLineParser parser(&settings);
|
||||
ASSERT(parser.ParseFromArgs(4, argv));
|
||||
ASSERT_EQUALS(1, parser.GetIgnoredPaths().size());
|
||||
ASSERT_EQUALS("src/", parser.GetIgnoredPaths()[0]);
|
||||
}
|
||||
|
||||
void ignorepaths3() {
|
||||
REDIRECT;
|
||||
const char *argv[] = {"cppcheck", "-isrc", "-imodule", "file.cpp"};
|
||||
CmdLineParser parser(&settings);
|
||||
ASSERT(parser.ParseFromArgs(4, argv));
|
||||
ASSERT_EQUALS(2, parser.GetIgnoredPaths().size());
|
||||
ASSERT_EQUALS("src/", parser.GetIgnoredPaths()[0]);
|
||||
ASSERT_EQUALS("module/", parser.GetIgnoredPaths()[1]);
|
||||
}
|
||||
*/
|
||||
void ignorepaths4() {
|
||||
REDIRECT;
|
||||
const char *argv[] = {"cppcheck", "-i", "src", "-i", "module", "file.cpp"};
|
||||
|
@ -964,16 +965,16 @@ private:
|
|||
ASSERT_EQUALS("src/", parser.GetIgnoredPaths()[0]);
|
||||
ASSERT_EQUALS("module/", parser.GetIgnoredPaths()[1]);
|
||||
}
|
||||
|
||||
void ignorefilepaths1() {
|
||||
REDIRECT;
|
||||
const char *argv[] = {"cppcheck", "-ifoo.cpp", "file.cpp"};
|
||||
CmdLineParser parser(&settings);
|
||||
ASSERT(parser.ParseFromArgs(3, argv));
|
||||
ASSERT_EQUALS(1, parser.GetIgnoredPaths().size());
|
||||
ASSERT_EQUALS("foo.cpp", parser.GetIgnoredPaths()[0]);
|
||||
}
|
||||
|
||||
/*
|
||||
void ignorefilepaths1() {
|
||||
REDIRECT;
|
||||
const char *argv[] = {"cppcheck", "-ifoo.cpp", "file.cpp"};
|
||||
CmdLineParser parser(&settings);
|
||||
ASSERT(parser.ParseFromArgs(3, argv));
|
||||
ASSERT_EQUALS(1, parser.GetIgnoredPaths().size());
|
||||
ASSERT_EQUALS("foo.cpp", parser.GetIgnoredPaths()[0]);
|
||||
}
|
||||
*/
|
||||
void ignorefilepaths2() {
|
||||
REDIRECT;
|
||||
const char *argv[] = {"cppcheck", "-isrc/foo.cpp", "file.cpp"};
|
||||
|
|
|
@ -1090,7 +1090,7 @@ private:
|
|||
}
|
||||
|
||||
void garbageCode144() { // #6865
|
||||
//ASSERT_THROW(checkCode("template < typename > struct A { } ; template < typename > struct A < INVALID > : A < int[ > { }] ;"), InternalError);
|
||||
checkCode("template < typename > struct A { } ; template < typename > struct A < INVALID > : A < int[ > { }] ;");
|
||||
}
|
||||
|
||||
void garbageCode146() { // #7081
|
||||
|
|
|
@ -57,7 +57,7 @@ private:
|
|||
TEST_CASE(version);
|
||||
}
|
||||
|
||||
Library::Error readLibrary(Library& library, const char* xmldata) const {
|
||||
static Library::Error readLibrary(Library& library, const char* xmldata) {
|
||||
tinyxml2::XMLDocument doc;
|
||||
doc.Parse(xmldata);
|
||||
return library.load(doc);
|
||||
|
|
Loading…
Reference in New Issue