mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
std.posix: Skip Stat struct comparison in fstatat test for s390x-linux.
On s390x-linux, fstat() does not have nanosecond precision, but fstatat() does. As a result, comparing Stat structs returned from these syscalls is doomed to fail.
This commit is contained in:
parent
f4c23726a3
commit
7f55fa12f4
1 changed files with 5 additions and 0 deletions
|
|
@ -368,6 +368,11 @@ test "fstatat" {
|
|||
// now repeat but using `fstatat` instead
|
||||
const flags = if (native_os == .wasi) 0x0 else posix.AT.SYMLINK_NOFOLLOW;
|
||||
const statat = try posix.fstatat(tmp.dir.fd, "file.txt", flags);
|
||||
|
||||
// s390x-linux does not have nanosecond precision for fstat(), but it does for fstatat(). As a
|
||||
// result, comparing the two structures is doomed to fail.
|
||||
if (builtin.cpu.arch == .s390x and builtin.os.tag == .linux) return error.SkipZigTest;
|
||||
|
||||
try expectEqual(stat, statat);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue