memory leaks: fixed a todo testcase
This commit is contained in:
parent
74fd052fc0
commit
ab047c680c
|
@ -891,6 +891,7 @@ Token *CheckMemoryLeakInFunction::getcode(const Token *tok, std::list<const Toke
|
||||||
if (tok2->varId() == varid)
|
if (tok2->varId() == varid)
|
||||||
{
|
{
|
||||||
addtoken("use");
|
addtoken("use");
|
||||||
|
tok = tok2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -322,9 +322,7 @@ private:
|
||||||
|
|
||||||
// alloc; return use;
|
// alloc; return use;
|
||||||
ASSERT_EQUALS(";;alloc;returnuse;", getcode("int *a = new int[10]; return a;", "a"));
|
ASSERT_EQUALS(";;alloc;returnuse;", getcode("int *a = new int[10]; return a;", "a"));
|
||||||
|
ASSERT_EQUALS(";;alloc;returnuse;", getcode("char *a = new char[100]; return (char *)a;", "a"));
|
||||||
TODO_ASSERT_EQUALS(";;alloc;returnuse;", getcode("char *a = new char[100]; return (char *)a;", "a"));
|
|
||||||
ASSERT_EQUALS(";;alloc;returnuseuse;", getcode("char *a = new char[100]; return (char *)a;", "a"));
|
|
||||||
|
|
||||||
// alloc; return;
|
// alloc; return;
|
||||||
ASSERT_EQUALS(";;alloc;return;", getcode("char *s = new char[100]; return 0;", "s"));
|
ASSERT_EQUALS(";;alloc;return;", getcode("char *s = new char[100]; return 0;", "s"));
|
||||||
|
|
Loading…
Reference in New Issue