Added unit test for #1473.
This commit is contained in:
parent
3950a62ef2
commit
838cac5a3a
|
@ -473,6 +473,13 @@ private:
|
|||
" fclose(a.f2);\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// #1473
|
||||
check("void foo() {\n"
|
||||
" FILE *a = fopen(\"aa\", \"r\");\n"
|
||||
" while (fclose(a)) {}\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("[test.cpp:3]: (error) Used file that is not opened.\n", errout.str());
|
||||
}
|
||||
|
||||
void fileIOwithoutPositioning() {
|
||||
|
|
Loading…
Reference in New Issue