Too young to die.

This commit is contained in:
Victor Zverovich 2014-05-03 20:49:42 -07:00
parent 590490f35f
commit e4f8b069b5

View File

@ -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) {
} }
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) {