mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-26 09:28:21 +00:00
Fix a test.
This commit is contained in:
parent
9c47f3e057
commit
897397760c
@ -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());
|
||||||
|
Loading…
Reference in New Issue
Block a user