ticket 3569: added further testcases

This commit is contained in:
Ettl Martin 2012-01-31 16:25:57 +01:00
parent 7110fa2c0c
commit c1e2802175
1 changed files with 32 additions and 0 deletions

View File

@ -1363,6 +1363,38 @@ private:
" free(p);\n" " free(p);\n"
"}\n"); "}\n");
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
check("void f()\n"
"{\n"
" char *p = new char[10];\n"
" p[0] = 0;\n"
" p[9] = 9;\n"
" delete [] p;\n"
"}\n");
ASSERT_EQUALS("", errout.str());
check("void f()\n"
"{\n"
" char *p(new char[10]);\n"
" p[0] = 0;\n"
" p[9] = 9;\n"
" delete [] p;\n"
"}\n");
ASSERT_EQUALS("", errout.str());
check("void f()\n"
"{\n"
" try{\n"
" char *p(new char[10]);\n"
" }\n"
" catch(...){\n"
" return;\n"
" }"
" p[0] = 0;\n"
" p[9] = 9;\n"
" delete [] p;\n"
"}\n");
ASSERT_EQUALS("", errout.str());
} }
void array_index_multidim() { void array_index_multidim() {