memory leaks: fixed todo test case. reduce exit better
This commit is contained in:
parent
085187b445
commit
8f1f89ae2b
|
@ -1263,6 +1263,13 @@ void CheckMemoryLeakInFunction::simplifycode(Token *tok, bool &all)
|
|||
done = false;
|
||||
}
|
||||
|
||||
// Reduce "; if(!var) exit ;" => ";"
|
||||
if (Token::Match(tok2, "; if(!var) exit ;"))
|
||||
{
|
||||
Token::eraseTokens(tok2, tok2->tokAt(3));
|
||||
done = false;
|
||||
}
|
||||
|
||||
// Remove "catch ;"
|
||||
if (Token::simpleMatch(tok2->next(), "catch ;"))
|
||||
{
|
||||
|
|
|
@ -456,11 +456,7 @@ private:
|
|||
// exit..
|
||||
ASSERT_EQUALS(";", simplifycode("; if { alloc; exit; }"));
|
||||
ASSERT_EQUALS("; alloc ;", simplifycode("; alloc ; if { use; exit; }"));
|
||||
|
||||
// Todo..
|
||||
ASSERT_EQUALS("; alloc ; if(!var) exit ;", simplifycode("; alloc ; if(!var) { exit; }"));
|
||||
TODO_ASSERT_EQUALS("; alloc ;", simplifycode("; alloc ; if(!var) { exit; }"));
|
||||
|
||||
ASSERT_EQUALS("; alloc ;", simplifycode("; alloc ; if(!var) { exit; }"));
|
||||
TODO_ASSERT_EQUALS(";", simplifycode("; alloc ; if(var) { exit; }"));
|
||||
TODO_ASSERT_EQUALS(";", simplifycode("; alloc ; ifv { exit; }", false));
|
||||
TODO_ASSERT_EQUALS("; alloc ;", simplifycode("; alloc ; ifv { exit; }", true));
|
||||
|
|
Loading…
Reference in New Issue