added additional tests to ticket #3862
This commit is contained in:
parent
1245abe094
commit
c42b21c503
|
@ -394,7 +394,8 @@ private:
|
|||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void return4() {
|
||||
void return4() { // ticket #3862
|
||||
// avoid false positives
|
||||
check("void f(char *p, int x) {\n"
|
||||
" if (x==12) {n"
|
||||
" free(p);\n"
|
||||
|
@ -403,6 +404,24 @@ private:
|
|||
" free(p);\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("void f(char *p, int x) {\n"
|
||||
" if (x==12) {n"
|
||||
" delete p;\n"
|
||||
" throw 1;\n"
|
||||
" }\n"
|
||||
" delete p;\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("void f(char *p, int x) {\n"
|
||||
" if (x==12) {n"
|
||||
" delete [] p;\n"
|
||||
" throw 1;\n"
|
||||
" }\n"
|
||||
" delete [] p;\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void test1() { // 3809
|
||||
|
|
Loading…
Reference in New Issue