Improve test coverage for detecting wrong file mode
This commit is contained in:
parent
0d888ba82d
commit
9564442167
|
@ -251,6 +251,12 @@ private:
|
|||
"}", false, false, Settings::Win32W);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("void foo(FILE*& f) {\n"
|
||||
" f = tmpfile();\n"
|
||||
" fwrite(buffer, 5, 6, f);\n"
|
||||
"}", false, false, Settings::Win32W);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// Write mode
|
||||
check("void foo(FILE*& f) {\n"
|
||||
" f = fopen(name, \"w\");\n"
|
||||
|
@ -266,6 +272,12 @@ private:
|
|||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("void foo(FILE*& f) {\n"
|
||||
" f = tmpfile();\n"
|
||||
" fread(buffer, 5, 6, f);\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// Append mode
|
||||
check("void foo(FILE*& f) {\n"
|
||||
" f = fopen(name, \"a\");\n"
|
||||
|
|
Loading…
Reference in New Issue