Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(684)

Side by Side Diff: src/pkg/syscall/syscall_bsd_test.go

Issue 84830043: code review 84830043: syscall: fix Getfsstat() for BSD
Patch Set: diff -r 519230b4d06a https://code.google.com/p/go Created 9 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/pkg/syscall/syscall_darwin.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 // +build freebsd dragonfly darwin openbsd
mikio 2014/04/07 01:01:54 alphanumeric order pls
6
7 package syscall_test
8
9 import (
10 "syscall"
11 "testing"
12 )
13
14 func TestGetfsstat(t *testing.T) {
15 n, err := syscall.Getfsstat(nil, 1 /* MNT_WAIT */)
mikio 2014/04/07 01:01:54 const MNT_WAIT = 1 is fine
16 if err != nil {
17 t.Fatalf("Getfsstat: %v", err)
mikio 2014/04/07 01:01:54 you can just write t.Fatal(err); i mean, looks lik
18 }
19
20 data := make([]syscall.Statfs_t, n)
21 n, err = syscall.Getfsstat(data, 1 /* MNT_WAIT */)
22 if err != nil {
23 t.Fatalf("Getfsstat: %v", err)
24 }
25
26 empty := syscall.Statfs_t{}
27 for _, stat := range data {
28 if stat == empty {
29 t.Fatal("An empty Statfs_t struct was returned.")
mikio 2014/04/07 01:01:54 perhaps s/An/an/ because testing package will add
30 }
31 }
32 }
OLDNEW
« no previous file with comments | « no previous file | src/pkg/syscall/syscall_darwin.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b