memory leaks: fixed a todo testcase

This commit is contained in:
Daniel Marjamäki 2009-08-29 06:42:24 +02:00
parent 74fd052fc0
commit ab047c680c
2 changed files with 2 additions and 3 deletions

View File

@ -891,6 +891,7 @@ Token *CheckMemoryLeakInFunction::getcode(const Token *tok, std::list<const Toke
if (tok2->varId() == varid)
{
addtoken("use");
tok = tok2;
break;
}
}

View File

@ -322,9 +322,7 @@ private:
// alloc; return use;
ASSERT_EQUALS(";;alloc;returnuse;", getcode("int *a = new int[10]; return 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"));
ASSERT_EQUALS(";;alloc;returnuse;", getcode("char *a = new char[100]; return (char *)a;", "a"));
// alloc; return;
ASSERT_EQUALS(";;alloc;return;", getcode("char *s = new char[100]; return 0;", "s"));