mirror of
https://github.com/golang/sys.git
synced 2026-02-08 03:36:03 +03:00
unix: compare Stat_t members in TestFstatat
TestFstatat occasionally fails on some builders due to mismatching Stat_t info returned by the calls to Fstatat (most likely due to Atime changing). Fix the test by just comparing some well known members. Change-Id: I862957ad9d3632173a97d93692a6c672779ac508 Reviewed-on: https://go-review.googlesource.com/c/sys/+/212417 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
committed by
Tobias Klauser
parent
abf886d6f5
commit
5a3cf8467b
@@ -680,8 +680,23 @@ func TestFstatat(t *testing.T) {
|
||||
t.Fatalf("Fstatat: %v", err)
|
||||
}
|
||||
|
||||
if st1 != st2 {
|
||||
t.Errorf("Fstatat: returned stat does not match Lstat")
|
||||
if st2.Dev != st1.Dev {
|
||||
t.Errorf("Fstatat: got dev %v, expected %v", st2.Dev, st1.Dev)
|
||||
}
|
||||
if st2.Ino != st1.Ino {
|
||||
t.Errorf("Fstatat: got ino %v, expected %v", st2.Ino, st1.Ino)
|
||||
}
|
||||
if st2.Mode != st1.Mode {
|
||||
t.Errorf("Fstatat: got mode %v, expected %v", st2.Mode, st1.Mode)
|
||||
}
|
||||
if st2.Uid != st1.Uid {
|
||||
t.Errorf("Fstatat: got uid %v, expected %v", st2.Uid, st1.Uid)
|
||||
}
|
||||
if st2.Gid != st1.Gid {
|
||||
t.Errorf("Fstatat: got gid %v, expected %v", st2.Gid, st1.Gid)
|
||||
}
|
||||
if st2.Size != st1.Size {
|
||||
t.Errorf("Fstatat: got size %v, expected %v", st2.Size, st1.Size)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user