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
fe0d2505
Commit
fe0d2505
authored
Apr 11, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
os.Open API fixes for examplelib.
parent
ffda34eb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
examplelib/multizip_test.go
examplelib/multizip_test.go
+4
-4
examplelib/stackfs_test.go
examplelib/stackfs_test.go
+6
-6
examplelib/zipfs_test.go
examplelib/zipfs_test.go
+2
-2
No files found.
examplelib/multizip_test.go
View file @
fe0d2505
...
...
@@ -23,7 +23,7 @@ func TestMultiZipFs(t *testing.T) {
go
state
.
Loop
(
true
)
f
,
err
:=
os
.
Open
(
mountPoint
+
""
,
os
.
O_RDONLY
,
0
)
f
,
err
:=
os
.
Open
(
mountPoint
+
""
)
CheckSuccess
(
err
)
names
,
err
:=
f
.
Readdirnames
(
-
1
)
...
...
@@ -35,16 +35,16 @@ func TestMultiZipFs(t *testing.T) {
err
=
f
.
Close
()
CheckSuccess
(
err
)
f
,
err
=
os
.
Open
(
mountPoint
+
"/random"
,
os
.
O_WRONLY
|
os
.
O_CREATE
,
0
)
f
,
err
=
os
.
Create
(
mountPoint
+
"/random"
)
if
err
==
nil
{
t
.
Error
(
"Must fail writing in root."
)
}
f
,
err
=
os
.
Open
(
mountPoint
+
"/config/zipmount"
,
os
.
O_WRONLY
,
0
)
f
,
err
=
os
.
Open
File
(
mountPoint
+
"/config/zipmount"
,
os
.
O_WRONLY
,
0
)
if
err
==
nil
{
t
.
Error
(
"Must fail without O_CREATE"
)
}
f
,
err
=
os
.
Open
(
mountPoint
+
"/config/zipmount"
,
os
.
O_WRONLY
|
os
.
O_CREATE
,
0
)
f
,
err
=
os
.
Create
(
mountPoint
+
"/config/zipmount"
)
CheckSuccess
(
err
)
// Directory exists, but is empty.
...
...
examplelib/stackfs_test.go
View file @
fe0d2505
...
...
@@ -76,7 +76,7 @@ func (me *stackFsTestCase) Cleanup() {
func
(
me
*
stackFsTestCase
)
testReaddir
()
{
fmt
.
Println
(
"testReaddir... "
)
dir
,
err
:=
os
.
Open
(
me
.
mountDir
,
os
.
O_RDONLY
,
0
)
dir
,
err
:=
os
.
Open
(
me
.
mountDir
)
CheckSuccess
(
err
)
infos
,
err
:=
dir
.
Readdir
(
10
)
CheckSuccess
(
err
)
...
...
@@ -114,13 +114,13 @@ func (me *stackFsTestCase) testSubFs() {
mountFile
:=
filepath
.
Join
(
mount
,
name
)
f
,
err
:=
os
.
Open
(
mountFile
,
os
.
O_WRONLY
,
0
)
f
,
err
:=
os
.
Open
File
(
mountFile
,
os
.
O_WRONLY
,
0
)
if
err
==
nil
{
me
.
tester
.
Errorf
(
"Expected error for open write %v"
,
name
)
continue
}
content1
:=
"booh!"
f
,
err
=
os
.
Open
(
mountFile
,
os
.
O_WRONLY
|
os
.
O_CREATE
,
magicMod
e
)
f
,
err
=
os
.
Create
(
mountFil
e
)
CheckSuccess
(
err
)
f
.
Write
([]
byte
(
content1
))
...
...
@@ -135,7 +135,7 @@ func (me *stackFsTestCase) testSubFs() {
me
.
tester
.
Errorf
(
"Mode %o"
,
fi
.
Mode
)
}
g
,
err
:=
os
.
Open
(
mountFile
,
os
.
O_RDONLY
,
0
)
g
,
err
:=
os
.
Open
(
mountFile
)
CheckSuccess
(
err
)
buf
:=
make
([]
byte
,
1024
)
...
...
@@ -177,7 +177,7 @@ func (me *stackFsTestCase) testAddRemove() {
if
fs
==
nil
{
me
.
tester
.
Errorf
(
"remove fail"
)
}
dir
,
err
:=
os
.
Open
(
me
.
mountDir
,
os
.
O_RDONLY
,
0
)
dir
,
err
:=
os
.
Open
(
me
.
mountDir
)
CheckSuccess
(
err
)
infos
,
err
:=
dir
.
Readdir
(
10
)
CheckSuccess
(
err
)
...
...
@@ -186,7 +186,7 @@ func (me *stackFsTestCase) testAddRemove() {
}
dir
.
Close
()
_
,
err
=
os
.
Open
(
filepath
.
Join
(
me
.
mountDir
,
"third"
)
,
os
.
O_RDONLY
,
0
)
_
,
err
=
os
.
Open
(
filepath
.
Join
(
me
.
mountDir
,
"third"
))
if
err
==
nil
{
me
.
tester
.
Errorf
(
"expect enoent %v"
,
err
)
}
...
...
examplelib/zipfs_test.go
View file @
fe0d2505
...
...
@@ -19,7 +19,7 @@ func TestZipFs(t *testing.T) {
go
state
.
Loop
(
false
)
d
,
err
:=
os
.
Open
(
mountPoint
,
os
.
O_RDONLY
,
0
)
d
,
err
:=
os
.
Open
(
mountPoint
)
CheckSuccess
(
err
)
names
,
err
:=
d
.
Readdirnames
(
-
1
)
...
...
@@ -43,7 +43,7 @@ func TestZipFs(t *testing.T) {
t
.
Error
(
"file type"
,
fi
)
}
f
,
err
:=
os
.
Open
(
mountPoint
+
"/file.txt"
,
os
.
O_RDONLY
,
0
)
f
,
err
:=
os
.
Open
(
mountPoint
+
"/file.txt"
)
CheckSuccess
(
err
)
b
:=
make
([]
byte
,
1024
)
...
...
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