testcppcheck: linenumbers are tested in the other tests

This commit is contained in:
Daniel Marjamäki 2011-01-16 16:21:34 +01:00
parent c841908149
commit 4661e38c65
1 changed files with 0 additions and 33 deletions

View File

@ -57,8 +57,6 @@ private:
void run()
{
TEST_CASE(nonexistingpath);
TEST_CASE(linenumbers);
// TEST_CASE(linenumbers2);
TEST_CASE(xml);
@ -312,37 +310,6 @@ private:
ASSERT_EQUALS(retval, EXIT_FAILURE);
}
void linenumbers()
{
const char filedata[] = "void f()\n"
"{\n"
" char *foo = new char[10];\n"
" delete [] foo;\n"
" foo[3] = 0;\n"
"}\n";
check(filedata);
// Compare results..
ASSERT_EQUALS("Checking file.cpp...\n", output.str());
ASSERT_EQUALS("[file.cpp:5]: (error) Dereferencing 'foo' after it is deallocated / released\n", errout.str());
}
void linenumbers2()
{
const char filedata[] = "void f()\n"
"{\n"
" char *string;\n"
" string = new char[20];\n"
" string = new char[30];\n"
" delete [] string;\n"
"}\n";
check(filedata);
// Compare results..
ASSERT_EQUALS("[file.cpp:5]: (error) Memory leak: string\n", errout.str());
}
void xml()
{
// Test the errorlogger..