Permalink
Browse files

revert: commit f6da9d4

 "testcmdlineparser: comment out unused functions fileListStdin(), ignorepaths{1-4}(), ignorefilepaths{1,2}()"
instead suppress the files.
also suppress unused variable in test/testpreprocessor.cpp
  • Loading branch information...
1 parent e1a5487 commit 962018b722c6a9a70bbe16aaab2ecf61371efcc3 @matthiaskrgr matthiaskrgr committed Jan 12, 2014
Showing with 54 additions and 52 deletions.
  1. +2 −0 .travis_suppressions
  2. +52 −52 test/testcmdlineparser.cpp
View
@@ -2,6 +2,8 @@ uselessAssignmentPtrArg:build/checkstl.cpp
assertWithSideEffect:build/checkuninitvar.cpp
duplicateBranch:build/checkunusedvar.cpp
duplicateBranch:lib/checkunusedvar.cpp
+unusedPrivateFunction:test/testcmdlineparser.cpp
+unreadVariable:test/testpreprocessor.cpp
*:gui/test*
*:test/test.cxx
View
@@ -925,63 +925,63 @@ class TestCmdlineParser : public TestFixture {
ASSERT_EQUALS(false, parser.ParseFromArgs(2, argv));
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 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 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 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 ignorepaths4() {
- REDIRECT;
- const char *argv[] = {"cppcheck", "-i", "src", "-i", "module", "file.cpp"};
- CmdLineParser parser(&settings);
- ASSERT(parser.ParseFromArgs(6, argv));
- ASSERT_EQUALS(2, parser.GetIgnoredPaths().size());
- ASSERT_EQUALS("src/", parser.GetIgnoredPaths()[0]);
- ASSERT_EQUALS("module/", parser.GetIgnoredPaths()[1]);
- }
+ 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 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 ignorepaths4() {
+ REDIRECT;
+ const char *argv[] = {"cppcheck", "-i", "src", "-i", "module", "file.cpp"};
+ CmdLineParser parser(&settings);
+ ASSERT(parser.ParseFromArgs(6, argv));
+ ASSERT_EQUALS(2, parser.GetIgnoredPaths().size());
+ 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 ignorefilepaths2() {
+ REDIRECT;
+ const char *argv[] = {"cppcheck", "-isrc/foo.cpp", "file.cpp"};
+ CmdLineParser parser(&settings);
+ ASSERT(parser.ParseFromArgs(3, argv));
+ ASSERT_EQUALS(1, parser.GetIgnoredPaths().size());
+ ASSERT_EQUALS("src/foo.cpp", parser.GetIgnoredPaths()[0]);
+ }
- void ignorefilepaths2() {
- REDIRECT;
- const char *argv[] = {"cppcheck", "-isrc/foo.cpp", "file.cpp"};
- CmdLineParser parser(&settings);
- ASSERT(parser.ParseFromArgs(3, argv));
- ASSERT_EQUALS(1, parser.GetIgnoredPaths().size());
- ASSERT_EQUALS("src/foo.cpp", parser.GetIgnoredPaths()[0]);
- }
- */
void checkconfig() {
REDIRECT;
const char *argv[] = {"cppcheck", "--check-config", "file.cpp"};

0 comments on commit 962018b

Please sign in to comment.