diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-09-23 10:17:51 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-23 10:17:51 -0400 |
commit | 2ca0e8f9a0f9863555a26e984cde15efff9ef8f8 (patch) | |
tree | daae1ee67b14a3d0a84424f2a304885d9e75ce2b /vendor/golang.org/x/sys/unix/syscall_bsd_test.go | |
parent | 6d62d65b2dc85855aabea036cbd44f6059e19d13 (diff) | |
download | chat-2ca0e8f9a0f9863555a26e984cde15efff9ef8f8.tar.gz chat-2ca0e8f9a0f9863555a26e984cde15efff9ef8f8.tar.bz2 chat-2ca0e8f9a0f9863555a26e984cde15efff9ef8f8.zip |
Updating golang dependancies (#4075)
Diffstat (limited to 'vendor/golang.org/x/sys/unix/syscall_bsd_test.go')
-rw-r--r-- | vendor/golang.org/x/sys/unix/syscall_bsd_test.go | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/vendor/golang.org/x/sys/unix/syscall_bsd_test.go b/vendor/golang.org/x/sys/unix/syscall_bsd_test.go index 2ad51290c..d8085a072 100644 --- a/vendor/golang.org/x/sys/unix/syscall_bsd_test.go +++ b/vendor/golang.org/x/sys/unix/syscall_bsd_test.go @@ -7,6 +7,7 @@ package unix_test import ( + "os/exec" "runtime" "testing" @@ -14,23 +15,37 @@ import ( ) const MNT_WAIT = 1 +const MNT_NOWAIT = 2 func TestGetfsstat(t *testing.T) { - n, err := unix.Getfsstat(nil, MNT_WAIT) + const flags = MNT_NOWAIT // see golang.org/issue/16937 + n, err := unix.Getfsstat(nil, flags) if err != nil { t.Fatal(err) } data := make([]unix.Statfs_t, n) - n, err = unix.Getfsstat(data, MNT_WAIT) + n2, err := unix.Getfsstat(data, flags) if err != nil { t.Fatal(err) } - - empty := unix.Statfs_t{} - for _, stat := range data { - if stat == empty { - t.Fatal("an empty Statfs_t struct was returned") + if n != n2 { + t.Errorf("Getfsstat(nil) = %d, but subsequent Getfsstat(slice) = %d", n, n2) + } + for i, stat := range data { + if stat == (unix.Statfs_t{}) { + t.Errorf("index %v is an empty Statfs_t struct", i) + } + } + if t.Failed() { + for i, stat := range data[:n2] { + t.Logf("data[%v] = %+v", i, stat) + } + mount, err := exec.Command("mount").CombinedOutput() + if err != nil { + t.Logf("mount: %v\n%s", err, mount) + } else { + t.Logf("mount: %s", mount) } } } |