Commit e4f8b069 authored by Victor Zverovich's avatar Victor Zverovich

Too young to die.

parent 590490f3
...@@ -336,6 +336,7 @@ TEST(FileTest, ReadError) { ...@@ -336,6 +336,7 @@ TEST(FileTest, ReadError) {
File read_end, write_end; File read_end, write_end;
File::pipe(read_end, write_end); File::pipe(read_end, write_end);
char buf; char buf;
// We intentionally read from write_end to cause error.
EXPECT_SYSTEM_ERROR(write_end.read(&buf, 1), EBADF, "cannot read from file"); EXPECT_SYSTEM_ERROR(write_end.read(&buf, 1), EBADF, "cannot read from file");
} }
...@@ -348,8 +349,10 @@ TEST(FileTest, Write) { ...@@ -348,8 +349,10 @@ TEST(FileTest, Write) {
} }
TEST(FileTest, WriteError) { TEST(FileTest, WriteError) {
File f; File read_end, write_end;
EXPECT_SYSTEM_ERROR_OR_DEATH(f.write(" ", 1), EBADF, "cannot write to file"); File::pipe(read_end, write_end);
// We intentionally write to read_end to cause error.
EXPECT_SYSTEM_ERROR(read_end.write(" ", 1), EBADF, "cannot write to file");
} }
TEST(FileTest, Dup) { TEST(FileTest, Dup) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment