macos: doTestUtimesNano: skip UTIME_OMIT and nanoseconds testcases

Not supported on macos.

Beef up the first test case a little by using different second
values.
This commit is contained in:
Jakob Unterwurzacher 2018-03-05 22:45:45 +01:00
parent 426b9536df
commit 870779ab1d

View File

@ -731,8 +731,8 @@ const _UTIME_OMIT = ((1 << 30) - 2)
func doTestUtimesNano(t *testing.T, path string) { func doTestUtimesNano(t *testing.T, path string) {
utimeTestcases := []utimesTestcaseStruct{ utimeTestcases := []utimesTestcaseStruct{
{ {
in: [2]syscall.Timespec{{Sec: 50, Nsec: 0}, {Sec: 50, Nsec: 0}}, in: [2]syscall.Timespec{{Sec: 50, Nsec: 0}, {Sec: 51, Nsec: 0}},
out: [2]syscall.Timespec{{Sec: 50, Nsec: 0}, {Sec: 50, Nsec: 0}}, out: [2]syscall.Timespec{{Sec: 50, Nsec: 0}, {Sec: 51, Nsec: 0}},
}, },
{ {
in: [2]syscall.Timespec{{Sec: 1, Nsec: 2}, {Sec: 3, Nsec: 4}}, in: [2]syscall.Timespec{{Sec: 1, Nsec: 2}, {Sec: 3, Nsec: 4}},
@ -747,6 +747,10 @@ func doTestUtimesNano(t *testing.T, path string) {
out: [2]syscall.Timespec{{Sec: 7, Nsec: 8}, {Sec: 5, Nsec: 6}}, out: [2]syscall.Timespec{{Sec: 7, Nsec: 8}, {Sec: 5, Nsec: 6}},
}, },
} }
if runtime.GOOS == "darwin" {
// darwin neither supports UTIME_OMIT nor nanoseconds (!?)
utimeTestcases = utimeTestcases[:1]
}
for i, tc := range utimeTestcases { for i, tc := range utimeTestcases {
err := syscall.UtimesNano(path, tc.in[:]) err := syscall.UtimesNano(path, tc.in[:])
if err != nil { if err != nil {