Merge pull request #214 from matthiaskrgr/unusedFuncts

remove/comment out some unused functions.
This commit is contained in:
Daniel Marjamäki 2014-01-10 12:23:45 -08:00
commit 2f30f9aa13
5 changed files with 6 additions and 29 deletions

View File

@ -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);

View File

@ -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"};

View File

@ -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) {
@ -220,15 +206,6 @@ void TestFixture::assertThrowFail(const char *filename, unsigned int linenr) con
}
}
void TestFixture::printTests()
{
const std::list<TestFixture *> &tests = TestRegistry::theInstance().tests();
for (std::list<TestFixture *>::const_iterator it = tests.begin(); it != tests.end(); ++it) {
std::cout << (*it)->classname << std::endl;
}
}
void TestFixture::run(const std::string &str)
{
testToRun = str;

View File

@ -67,13 +67,11 @@ public:
TestFixture(const std::string &_name);
virtual ~TestFixture() { }
static void printTests();
static std::size_t runTests(const options& args);
};
#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)

View File

@ -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)