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
69c97c57
Commit
69c97c57
authored
Sep 09, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
StatFSTest.UnsupportedBlockSizes
parent
c96d308a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
1 deletion
+44
-1
samples/statfs/statfs_test.go
samples/statfs/statfs_test.go
+44
-1
No files found.
samples/statfs/statfs_test.go
View file @
69c97c57
...
@@ -270,5 +270,48 @@ func (t *StatFSTest) WriteSize() {
...
@@ -270,5 +270,48 @@ func (t *StatFSTest) WriteSize() {
}
}
func
(
t
*
StatFSTest
)
UnsupportedBlockSizes
()
{
func
(
t
*
StatFSTest
)
UnsupportedBlockSizes
()
{
AssertTrue
(
false
,
"TODO"
)
var
err
error
// Test a bunch of block sizes that the OS doesn't support faithfully,
// checking what it transforms them too.
testCases
:=
[]
struct
{
fsBlockSize
uint32
expectedBsize
uint32
expectedIosize
uint32
}{
0
:
{
0
,
4096
,
65536
},
1
:
{
1
,
512
,
512
},
2
:
{
3
,
512
,
512
},
3
:
{
511
,
512
,
512
},
4
:
{
513
,
1024
,
1024
},
5
:
{
1023
,
1024
,
1024
},
6
:
{
4095
,
4096
,
4096
},
7
:
{
1
<<
17
-
1
,
1
<<
17
,
131072
},
8
:
{
1
<<
17
+
1
,
1
<<
17
,
1
<<
18
},
9
:
{
1
<<
18
+
1
,
1
<<
17
,
1
<<
19
},
10
:
{
1
<<
19
+
1
,
1
<<
17
,
1
<<
20
},
11
:
{
1
<<
20
+
1
,
1
<<
17
,
1
<<
20
},
12
:
{
1
<<
21
,
1
<<
17
,
1
<<
20
},
13
:
{
1
<<
30
,
1
<<
17
,
1
<<
20
},
}
for
i
,
tc
:=
range
testCases
{
desc
:=
fmt
.
Sprintf
(
"Case %d: block size %d"
,
i
,
tc
.
fsBlockSize
)
// Set up.
canned
:=
fuseops
.
StatFSOp
{
BlockSize
:
tc
.
fsBlockSize
,
Blocks
:
10
,
}
t
.
fs
.
SetStatFSResponse
(
canned
)
// Check.
var
stat
syscall
.
Statfs_t
err
=
syscall
.
Statfs
(
t
.
Dir
,
&
stat
)
AssertEq
(
nil
,
err
)
ExpectEq
(
tc
.
expectedBsize
,
stat
.
Bsize
,
"%s"
,
desc
)
ExpectEq
(
tc
.
expectedIosize
,
stat
.
Iosize
,
"%s"
,
desc
)
}
}
}
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