Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Levin Zimmermann
go-fuse
Commits
f0d19206
Commit
f0d19206
authored
Mar 19, 2013
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
benchmark: Drop CheckSuccess calls.
parent
f7f8b159
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
10 deletions
+24
-10
benchmark/stat_test.go
benchmark/stat_test.go
+24
-10
No files found.
benchmark/stat_test.go
View file @
f0d19206
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment