Fix a test.

This commit is contained in:
Victor Zverovich 2014-07-09 09:55:13 -07:00
parent 9c47f3e057
commit 897397760c

View File

@ -520,7 +520,14 @@ TEST(BufferedFileTest, CloseError) {
TEST(BufferedFileTest, Fileno) { TEST(BufferedFileTest, Fileno) {
BufferedFile f; BufferedFile f;
EXPECT_DEATH(f.fileno(), ""); // fileno on a null FILE pointer either crashes or returns an error.
EXPECT_DEATH({
try {
f.fileno();
} catch (fmt::SystemError) {
std::exit(0);
}
}, "");
f = OpenBufferedFile(); f = OpenBufferedFile();
EXPECT_TRUE(f.fileno() != -1); EXPECT_TRUE(f.fileno() != -1);
File copy = File::dup(f.fileno()); File copy = File::dup(f.fileno());