Commit f0d19206 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

benchmark: Drop CheckSuccess calls.

parent f7f8b159
...@@ -14,8 +14,6 @@ import ( ...@@ -14,8 +14,6 @@ import (
"time" "time"
) )
var CheckSuccess = fuse.CheckSuccess
func setupFs(fs fuse.FileSystem) (string, func()) { func setupFs(fs fuse.FileSystem) (string, func()) {
opts := &fuse.FileSystemOptions{ opts := &fuse.FileSystemOptions{
EntryTimeout: 0.0, EntryTimeout: 0.0,
...@@ -60,29 +58,39 @@ func TestNewStatFs(t *testing.T) { ...@@ -60,29 +58,39 @@ func TestNewStatFs(t *testing.T) {
defer clean() defer clean()
names, err := ioutil.ReadDir(wd) names, err := ioutil.ReadDir(wd)
CheckSuccess(err) if err != nil {
t.Fatalf("failed: %v", err)
}
if len(names) != 2 { if len(names) != 2 {
t.Error("readdir /", names) t.Error("readdir /", names)
} }
fi, err := os.Lstat(wd + "/sub") fi, err := os.Lstat(wd + "/sub")
CheckSuccess(err) if err != nil {
t.Fatalf("failed: %v", err)
}
if !fi.IsDir() { if !fi.IsDir() {
t.Error("mode", fi) t.Error("mode", fi)
} }
names, err = ioutil.ReadDir(wd + "/sub") names, err = ioutil.ReadDir(wd + "/sub")
CheckSuccess(err) if err != nil {
t.Fatalf("failed: %v", err)
}
if len(names) != 2 { if len(names) != 2 {
t.Error("readdir /sub", names) t.Error("readdir /sub", names)
} }
names, err = ioutil.ReadDir(wd + "/sub/dir") names, err = ioutil.ReadDir(wd + "/sub/dir")
CheckSuccess(err) if err != nil {
t.Fatalf("failed: %v", err)
}
if len(names) != 2 { if len(names) != 2 {
t.Error("readdir /sub/dir", names) t.Error("readdir /sub/dir", names)
} }
fi, err = os.Lstat(wd + "/sub/marine.txt") fi, err = os.Lstat(wd + "/sub/marine.txt")
CheckSuccess(err) if err != nil {
t.Fatalf("failed: %v", err)
}
if fi.Mode()&os.ModeType != 0 { if fi.Mode()&os.ModeType != 0 {
t.Error("mode", fi) t.Error("mode", fi)
} }
...@@ -163,7 +171,9 @@ func BenchmarkCFuseThreadedStat(b *testing.B) { ...@@ -163,7 +171,9 @@ func BenchmarkCFuseThreadedStat(b *testing.B) {
} }
f, err := ioutil.TempFile("", "") f, err := ioutil.TempFile("", "")
CheckSuccess(err) if err != nil {
b.Fatalf("failed: %v", err)
}
sort.Strings(out) sort.Strings(out)
for _, k := range out { for _, k := range out {
f.Write([]byte(fmt.Sprintf("/%s\n", k))) f.Write([]byte(fmt.Sprintf("/%s\n", k)))
...@@ -181,9 +191,13 @@ func BenchmarkCFuseThreadedStat(b *testing.B) { ...@@ -181,9 +191,13 @@ func BenchmarkCFuseThreadedStat(b *testing.B) {
cmd.Start() cmd.Start()
bin, err := exec.LookPath("fusermount") bin, err := exec.LookPath("fusermount")
CheckSuccess(err) if err != nil {
b.Fatalf("failed: %v", err)
}
stop := exec.Command(bin, "-u", mountPoint) stop := exec.Command(bin, "-u", mountPoint)
CheckSuccess(err) if err != nil {
b.Fatalf("failed: %v", err)
}
defer stop.Run() defer stop.Run()
for i, l := range lines { for i, l := range lines {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment