From 3602cc2f6a427d58a6f215c0acbefd3214effc8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Mon, 6 Jan 2014 17:04:38 +0100 Subject: [PATCH 1/5] testsymboldatabase: run symboldatabase32, probably someone forgot to implement this. --- test/testsymboldatabase.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testsymboldatabase.cpp b/test/testsymboldatabase.cpp index 5167aa2b8..fef686b15 100644 --- a/test/testsymboldatabase.cpp +++ b/test/testsymboldatabase.cpp @@ -194,6 +194,7 @@ private: TEST_CASE(symboldatabase29); // ticket #4442 (segmentation fault) TEST_CASE(symboldatabase30); TEST_CASE(symboldatabase31); + TEST_CASE(symboldatabase32); TEST_CASE(symboldatabase33); // ticket #4682 (false negatives) TEST_CASE(symboldatabase34); // ticket #4694 (segmentation fault) TEST_CASE(symboldatabase35); // ticket #4806 (segmentation fault) From 6feb0faf4cb68e15b5612da90945c2c3bd4b7dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Mon, 6 Jan 2014 17:09:21 +0100 Subject: [PATCH 2/5] testbool: same for checkComparisonOfBoolWithBool --- test/testbool.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testbool.cpp b/test/testbool.cpp index 2e832a6cb..b427d9b02 100644 --- a/test/testbool.cpp +++ b/test/testbool.cpp @@ -56,6 +56,7 @@ private: TEST_CASE(checkComparisonOfFuncReturningBool4); TEST_CASE(checkComparisonOfFuncReturningBool5); TEST_CASE(checkComparisonOfFuncReturningBool6); + TEST_CASE(checkComparisonOfBoolWithBool); // Converting pointer addition result to bool TEST_CASE(pointerArithBool1); From d9ce61a9d6f9cbfb970a1f46eba66662877324c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Mon, 6 Jan 2014 17:19:08 +0100 Subject: [PATCH 3/5] testsuite: according to cppcheck, the function printTests() is not used, remove it. --- test/testsuite.cpp | 9 --------- test/testsuite.h | 1 - 2 files changed, 10 deletions(-) diff --git a/test/testsuite.cpp b/test/testsuite.cpp index 86337cf7c..b60fdf10c 100644 --- a/test/testsuite.cpp +++ b/test/testsuite.cpp @@ -220,15 +220,6 @@ void TestFixture::assertThrowFail(const char *filename, unsigned int linenr) con } } -void TestFixture::printTests() -{ - const std::list &tests = TestRegistry::theInstance().tests(); - - for (std::list::const_iterator it = tests.begin(); it != tests.end(); ++it) { - std::cout << (*it)->classname << std::endl; - } -} - void TestFixture::run(const std::string &str) { testToRun = str; diff --git a/test/testsuite.h b/test/testsuite.h index b6e44090d..b6b100f3c 100644 --- a/test/testsuite.h +++ b/test/testsuite.h @@ -67,7 +67,6 @@ public: TestFixture(const std::string &_name); virtual ~TestFixture() { } - static void printTests(); static std::size_t runTests(const options& args); }; From 4f918e1c8c23278b6ff2f868e6cab026d6375b41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Mon, 6 Jan 2014 17:29:20 +0100 Subject: [PATCH 4/5] testsuite: remove function todoAssert() which is unused according to cppcheck. --- test/testsuite.cpp | 14 -------------- test/testsuite.h | 1 - 2 files changed, 15 deletions(-) diff --git a/test/testsuite.cpp b/test/testsuite.cpp index b60fdf10c..3769adee8 100644 --- a/test/testsuite.cpp +++ b/test/testsuite.cpp @@ -122,20 +122,6 @@ void TestFixture::assert_(const char *filename, unsigned int linenr, bool condit } } -void TestFixture::todoAssert(const char *filename, unsigned int linenr, bool condition) const -{ - if (condition) { - if (gcc_style_errors) { - errmsg << filename << ':' << linenr << ": Assertion succeeded unexpectedly." << std::endl; - } else { - errmsg << "Assertion succeeded unexpectedly in " << filename << " at line " << linenr << std::endl; - } - ++succeeded_todos_counter; - } else { - ++todos_counter; - } -} - void TestFixture::assertEquals(const char *filename, unsigned int linenr, const std::string &expected, const std::string &actual, const std::string &msg) const { if (expected != actual) { diff --git a/test/testsuite.h b/test/testsuite.h index b6b100f3c..5a089e6fe 100644 --- a/test/testsuite.h +++ b/test/testsuite.h @@ -72,7 +72,6 @@ public: #define TEST_CASE( NAME ) if ( runTest(#NAME) ) { currentTest = classname + "::" + #NAME; if (quiet_tests) { REDIRECT; NAME(); } else { NAME ();} } #define ASSERT( CONDITION ) assert_(__FILE__, __LINE__, CONDITION) -#define TODO_ASSERT( CONDITION ) todoAssert(__FILE__, __LINE__, CONDITION) #define ASSERT_EQUALS( EXPECTED , ACTUAL ) assertEquals(__FILE__, __LINE__, EXPECTED, ACTUAL) #define ASSERT_EQUALS_DOUBLE( EXPECTED , ACTUAL ) assertEqualsDouble(__FILE__, __LINE__, EXPECTED, ACTUAL) #define ASSERT_EQUALS_MSG( EXPECTED , ACTUAL, MSG ) assertEquals(__FILE__, __LINE__, EXPECTED, ACTUAL, MSG) From f6da9d4e3c2f889be5202b1cbcc159ec3ff9a37b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Mon, 6 Jan 2014 17:34:20 +0100 Subject: [PATCH 5/5] testcmdlineparser: comment out unused functions fileListStdin(), ignorepaths{1-4}(), ignorefilepaths{1,2}() --- test/testcmdlineparser.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/testcmdlineparser.cpp b/test/testcmdlineparser.cpp index d3ad863d4..4f36dbd72 100644 --- a/test/testcmdlineparser.cpp +++ b/test/testcmdlineparser.cpp @@ -602,13 +602,13 @@ private: TODO_ASSERT_EQUALS(true, false, defParser.ParseFromArgs(4, argv)); } - void fileListStdin() { +/* void fileListStdin() { // TODO: Give it some stdin to read from, fails because the list of // files in stdin (_pathnames) is empty REDIRECT; const char *argv[] = {"cppcheck", "--file-list=-", "file.cpp"}; TODO_ASSERT_EQUALS(true, false, defParser.ParseFromArgs(3, argv)); - } + } */ void inlineSuppr() { REDIRECT; @@ -925,7 +925,7 @@ private: ASSERT_EQUALS(false, parser.ParseFromArgs(2, argv)); ASSERT_EQUALS(0, parser.GetIgnoredPaths().size()); } - +/* void ignorepaths1() { REDIRECT; const char *argv[] = {"cppcheck", "-isrc", "file.cpp"}; @@ -981,7 +981,7 @@ private: 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"};