tests: OSX compat: wrap Stat_t atime extract
Linux has st.Atim, st.Mtim, OSX hat st.Atimespec, st.Mtimespec. Reported at https://github.com/rfjakob/gocryptfs/issues/15#issuecomment-279130217
This commit is contained in:
parent
8bbc1038fe
commit
0b19e637c9
9
tests/matrix/atime_darwin.go
Normal file
9
tests/matrix/atime_darwin.go
Normal file
@ -0,0 +1,9 @@
|
||||
package matrix
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func extractAtimeMtime(st syscall.Stat_t) [2]syscall.Timespec {
|
||||
return [2]syscall.Timespec{st.Atimespec, st.Mtimespec}
|
||||
}
|
9
tests/matrix/atime_linux.go
Normal file
9
tests/matrix/atime_linux.go
Normal file
@ -0,0 +1,9 @@
|
||||
package matrix
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func extractAtimeMtime(st syscall.Stat_t) [2]syscall.Timespec {
|
||||
return [2]syscall.Timespec{st.Atim, st.Mtim}
|
||||
}
|
@ -725,7 +725,7 @@ func doTestUtimesNano(t *testing.T, path string) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
err = compareUtimes(tc.out, [2]syscall.Timespec{st.Atim, st.Mtim})
|
||||
err = compareUtimes(tc.out, extractAtimeMtime(st))
|
||||
if err != nil {
|
||||
t.Errorf("Testcase %d: %v", i, err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user