mismatching allocation and deallocation: added test case that currently generates false positives
This commit is contained in:
parent
3457b38d7a
commit
25607d9f71
|
@ -119,6 +119,7 @@ private:
|
||||||
TEST_CASE(ret5); // Bug 2458436 - return use
|
TEST_CASE(ret5); // Bug 2458436 - return use
|
||||||
|
|
||||||
TEST_CASE(mismatch1);
|
TEST_CASE(mismatch1);
|
||||||
|
// TODO TEST_CASE(mismatch2);
|
||||||
|
|
||||||
TEST_CASE(func1);
|
TEST_CASE(func1);
|
||||||
TEST_CASE(func2);
|
TEST_CASE(func2);
|
||||||
|
@ -952,6 +953,20 @@ private:
|
||||||
ASSERT_EQUALS(std::string("[test.cpp:4]: (always) Mismatching allocation and deallocation: a\n"), errout.str());
|
ASSERT_EQUALS(std::string("[test.cpp:4]: (always) Mismatching allocation and deallocation: a\n"), errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mismatch2()
|
||||||
|
{
|
||||||
|
check("void f()\n"
|
||||||
|
"{\n"
|
||||||
|
" FILE *fp;\n"
|
||||||
|
"\n"
|
||||||
|
" fp = fopen();\n"
|
||||||
|
" fclose(fp);\n"
|
||||||
|
"\n"
|
||||||
|
" fp = popen();\n"
|
||||||
|
" pclose(fp);\n"
|
||||||
|
"}\n");
|
||||||
|
ASSERT_EQUALS(std::string(""), errout.str());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue