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
d2445f67
Commit
d2445f67
authored
Mar 23, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed FlushFSTest.Dup for darwin.
parent
51062a14
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
samples/flushfs/flush_fs_test.go
samples/flushfs/flush_fs_test.go
+16
-5
No files found.
samples/flushfs/flush_fs_test.go
View file @
d2445f67
...
...
@@ -19,6 +19,7 @@ import (
"io/ioutil"
"os"
"path"
"runtime"
"sync"
"syscall"
"testing"
...
...
@@ -417,6 +418,9 @@ func (t *FlushFSTest) Dup() {
var
n
int
var
err
error
isDarwin
:=
runtime
.
GOOS
==
"darwin"
var
expectedFlushes
[]
interface
{}
// Open the file.
t
.
f1
,
err
=
os
.
OpenFile
(
path
.
Join
(
t
.
Dir
,
"foo"
),
os
.
O_WRONLY
,
0
)
AssertEq
(
nil
,
err
)
...
...
@@ -442,12 +446,18 @@ func (t *FlushFSTest) Dup() {
AssertThat
(
t
.
getFlushes
(),
ElementsAre
())
AssertThat
(
t
.
getFsyncs
(),
ElementsAre
())
// Close one handle. The current contents should be flushed.
// Close one handle. On Linux the current contents should be flushed. On OS
// X, where the semantics of handles are different, they apparently are not.
// (Cf. https://github.com/osxfuse/osxfuse/issues/199)
err
=
t
.
f1
.
Close
()
t
.
f1
=
nil
AssertEq
(
nil
,
err
)
AssertThat
(
t
.
getFlushes
(),
ElementsAre
(
"tacos"
))
if
!
isDarwin
{
expectedFlushes
=
append
(
expectedFlushes
,
"tacos"
)
}
AssertThat
(
t
.
getFlushes
(),
ElementsAre
(
expectedFlushes
...
))
AssertThat
(
t
.
getFsyncs
(),
ElementsAre
())
// Write some more contents via the other handle. Again, no further flushes.
...
...
@@ -455,7 +465,7 @@ func (t *FlushFSTest) Dup() {
AssertEq
(
nil
,
err
)
AssertEq
(
1
,
n
)
AssertThat
(
t
.
getFlushes
(),
ElementsAre
(
"tacos"
))
AssertThat
(
t
.
getFlushes
(),
ElementsAre
(
expectedFlushes
...
))
AssertThat
(
t
.
getFsyncs
(),
ElementsAre
())
// Close the handle. Now the new contents should be flushed.
...
...
@@ -463,8 +473,9 @@ func (t *FlushFSTest) Dup() {
t
.
f2
=
nil
AssertEq
(
nil
,
err
)
AssertThat
(
t
.
getFlushes
(),
ElementsAre
(
"tacos"
,
"tacos!"
))
AssertThat
(
t
.
getFsyncs
(),
ElementsAre
())
expectedFlushes
=
append
(
expectedFlushes
,
"tacos!"
)
ExpectThat
(
t
.
getFlushes
(),
ElementsAre
(
expectedFlushes
...
))
ExpectThat
(
t
.
getFsyncs
(),
ElementsAre
())
}
func
(
t
*
FlushFSTest
)
Dup_FlushError
()
{
...
...
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