From f347efd8027d537d3f7eb148b308b7055305e08b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 11 Nov 2008 19:46:08 +0000 Subject: [PATCH] Memory leak: Fixed one more unit test --- CheckMemoryLeak.cpp | 5 +++++ testmemleak.cpp | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CheckMemoryLeak.cpp b/CheckMemoryLeak.cpp index cf6638c2a..21ca38761 100644 --- a/CheckMemoryLeak.cpp +++ b/CheckMemoryLeak.cpp @@ -788,6 +788,11 @@ void CheckMemoryLeakClass::CheckMemoryLeak_CheckScope( const TOKEN *Tok1, const MemoryLeak(Tokenizer::gettok(findmatch(tok, "alloc ; if continue ;"), 3), varname); } + else if ( findmatch(tok, "alloc ; if break ;") ) + { + MemoryLeak(Tokenizer::gettok(findmatch(tok, "alloc ; if break ;"), 3), varname); + } + else if ( findmatch(tok, "alloc ; if return ;") ) { MemoryLeak(Tokenizer::gettok(findmatch(tok, "alloc ; if return ;"), 3), varname); diff --git a/testmemleak.cpp b/testmemleak.cpp index 6cbcabf61..1b1177670 100644 --- a/testmemleak.cpp +++ b/testmemleak.cpp @@ -51,7 +51,7 @@ private: // Check for memory leaks.. ShowAll = false; FillFunctionList(0); - CheckMemoryLeakClass checkMemoryLeak; + CheckMemoryLeakClass checkMemoryLeak; checkMemoryLeak.CheckMemoryLeak(); tokenizer.DeallocateTokens(); @@ -89,7 +89,7 @@ private: TEST_CASE( forwhile4 ); TEST_CASE( forwhile5 ); TEST_CASE( forwhile6 ); - // TODO TEST_CASE( forwhile7 ); + TEST_CASE( forwhile7 ); TEST_CASE( dowhile1 ); @@ -494,7 +494,6 @@ private: void forwhile7() { - // TODO check("void f()\n" "{\n" " for (int i = 0; i < j; i++)\n"