Skip to content

Commit 2b7ef71

Browse files
committed
Improve test coverage for accessing closed files
1 parent 9fdfada commit 2b7ef71

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

test/testio.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,12 +386,14 @@ class TestIO : public TestFixture {
386386
" fread(buffer, 5, 6, f);\n"
387387
" ungetc('a', f);\n"
388388
" ungetwc(L'a', f);\n"
389+
" rewind(f);\n"
389390
"}");
390391
ASSERT_EQUALS("[test.cpp:3]: (error) Used file that is not opened.\n"
391392
"[test.cpp:4]: (error) Used file that is not opened.\n"
392393
"[test.cpp:5]: (error) Used file that is not opened.\n"
393394
"[test.cpp:6]: (error) Used file that is not opened.\n"
394-
"[test.cpp:7]: (error) Used file that is not opened.\n", errout.str());
395+
"[test.cpp:7]: (error) Used file that is not opened.\n"
396+
"[test.cpp:8]: (error) Used file that is not opened.\n", errout.str());
395397

396398
check("void foo(FILE*& f) {\n"
397399
" if(!ferror(f)) {\n"

0 commit comments

Comments
 (0)