Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-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
Kirill Smelkov
jacobsa-fuse
Commits
5b359358
Commit
5b359358
authored
Sep 09, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
StatFSTest.Syscall_ZeroValues
parent
da3ee980
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
1 deletion
+48
-1
samples/statfs/statfs_test.go
samples/statfs/statfs_test.go
+48
-1
No files found.
samples/statfs/statfs_test.go
View file @
5b359358
...
...
@@ -15,16 +15,38 @@
package
statfs_test
import
(
"path"
"path/filepath"
"syscall"
"testing"
"github.com/jacobsa/fuse/fuseutil"
"github.com/jacobsa/fuse/samples"
"github.com/jacobsa/fuse/samples/statfs"
.
"github.com/jacobsa/oglematchers"
.
"github.com/jacobsa/ogletest"
)
func
TestStatFS
(
t
*
testing
.
T
)
{
RunTests
(
t
)
}
////////////////////////////////////////////////////////////////////////
// Helpers
////////////////////////////////////////////////////////////////////////
func
convertName
(
in
[]
int8
)
(
s
string
)
{
var
tmp
[]
byte
for
_
,
v
:=
range
in
{
if
v
==
0
{
break
}
tmp
=
append
(
tmp
,
byte
(
v
))
}
s
=
string
(
tmp
)
return
}
////////////////////////////////////////////////////////////////////////
// Boilerplate
////////////////////////////////////////////////////////////////////////
...
...
@@ -58,7 +80,32 @@ func (t *StatFSTest) SetUp(ti *TestInfo) {
////////////////////////////////////////////////////////////////////////
func
(
t
*
StatFSTest
)
Syscall_ZeroValues
()
{
AssertTrue
(
false
,
"TODO"
)
var
err
error
var
stat
syscall
.
Statfs_t
// Compute the canonicalized directory, for use below.
canonicalDir
,
err
:=
filepath
.
EvalSymlinks
(
t
.
Dir
)
AssertEq
(
nil
,
err
)
canonicalDir
=
path
.
Clean
(
canonicalDir
)
// Call without configuring a canned response, meaning the OS will see the
// zero value for each field. The assertions below act as documentation for
// the OS's behavior in this case.
err
=
syscall
.
Statfs
(
t
.
Dir
,
&
stat
)
AssertEq
(
nil
,
err
)
ExpectEq
(
4096
,
stat
.
Bsize
)
ExpectEq
(
65536
,
stat
.
Iosize
)
ExpectEq
(
0
,
stat
.
Blocks
)
ExpectEq
(
0
,
stat
.
Bfree
)
ExpectEq
(
0
,
stat
.
Bavail
)
ExpectEq
(
0
,
stat
.
Files
)
ExpectEq
(
0
,
stat
.
Ffree
)
ExpectEq
(
"osxfusefs"
,
convertName
(
stat
.
Fstypename
[
:
]))
ExpectEq
(
canonicalDir
,
convertName
(
stat
.
Mntonname
[
:
]))
ExpectThat
(
convertName
(
stat
.
Mntfromname
[
:
]),
MatchesRegexp
(
`mount_osxfusefs@osxfuse\d+`
))
}
func
(
t
*
StatFSTest
)
Syscall_NonZeroValues
()
{
...
...
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