You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/testio.cpp
+13-7Lines changed: 13 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -745,27 +745,33 @@ class TestIO : public TestFixture {
745
745
}
746
746
747
747
voidtestWrongfeofUsage() { // ticket #958
748
-
check("void foo() {\n"
749
-
" FILE * fp = fopen(\"test.txt\", \"r\");\n"
748
+
check("void foo(FILE * fp) {\n"
750
749
" while (!feof(fp)) \n"
751
750
" {\n"
752
751
" char line[100];\n"
753
752
" fgets(line, sizeof(line), fp);\n"
754
753
" }\n"
755
-
" fclose(fp);\n"
756
754
"}");
757
-
ASSERT_EQUALS("[test.cpp:3:10]: (warning) Using feof() as a loop condition may cause the last line to be processed twice. [wrongfeofUsage]\n", errout_str());
755
+
ASSERT_EQUALS("[test.cpp:2:10]: (warning) Using feof() as a loop condition causes the last line to be processed twice. [wrongfeofUsage]\n", errout_str());
0 commit comments