mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-26 12:35:32 +00:00
Fix posix-test on FreeBSD (#179)
This commit is contained in:
parent
761a0afb85
commit
88c7c20102
@ -292,11 +292,11 @@ TEST(FileTest, Read) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST(FileTest, ReadError) {
|
TEST(FileTest, ReadError) {
|
||||||
File read_end, write_end;
|
File f("test-file", File::WRONLY);
|
||||||
File::pipe(read_end, write_end);
|
|
||||||
char buf;
|
char buf;
|
||||||
// We intentionally read from write_end to cause error.
|
// We intentionally read from a file opened in the write-only mode to
|
||||||
EXPECT_SYSTEM_ERROR(write_end.read(&buf, 1), EBADF, "cannot read from file");
|
// cause error.
|
||||||
|
EXPECT_SYSTEM_ERROR(f.read(&buf, 1), EBADF, "cannot read from file");
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(FileTest, Write) {
|
TEST(FileTest, Write) {
|
||||||
@ -308,10 +308,10 @@ TEST(FileTest, Write) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST(FileTest, WriteError) {
|
TEST(FileTest, WriteError) {
|
||||||
File read_end, write_end;
|
File f("test-file", File::RDONLY);
|
||||||
File::pipe(read_end, write_end);
|
// We intentionally write to a file opened in the read-only mode to
|
||||||
// We intentionally write to read_end to cause error.
|
// cause error.
|
||||||
EXPECT_SYSTEM_ERROR(read_end.write(" ", 1), EBADF, "cannot write to file");
|
EXPECT_SYSTEM_ERROR(f.write(" ", 1), EBADF, "cannot write to file");
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(FileTest, Dup) {
|
TEST(FileTest, Dup) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user