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
Kirill Smelkov
go-fuse
Commits
51f7b76c
Commit
51f7b76c
authored
Jan 14, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove naming conflicts in newly added stackfs test code.
parent
02a3355d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
25 deletions
+8
-25
examplelib/stackfs_test.go
examplelib/stackfs_test.go
+8
-25
No files found.
examplelib/stackfs_test.go
View file @
51f7b76c
...
...
@@ -15,25 +15,10 @@ var _ = log.Println
////////////////
func
IsDir
(
name
string
)
bool
{
fi
,
_
:=
os
.
Lstat
(
name
)
return
fi
!=
nil
&&
fi
.
IsDirectory
()
}
func
IsFile
(
name
string
)
bool
{
fi
,
_
:=
os
.
Lstat
(
name
)
return
fi
!=
nil
&&
fi
.
IsRegular
()
}
func
FileExists
(
name
string
)
bool
{
_
,
err
:=
os
.
Lstat
(
name
)
return
err
==
nil
}
// Create and mount filesystem.
const
magicMode
uint32
=
0753
type
t
estCase
struct
{
type
stackFsT
estCase
struct
{
origDir1
string
origDir2
string
mountDir
string
...
...
@@ -44,7 +29,7 @@ type testCase struct {
state
*
fuse
.
MountState
}
func
(
self
*
t
estCase
)
Setup
(
t
*
testing
.
T
)
{
func
(
self
*
stackFsT
estCase
)
Setup
(
t
*
testing
.
T
)
{
self
.
tester
=
t
self
.
testDir
=
fuse
.
MakeTempDir
()
...
...
@@ -80,7 +65,7 @@ func (self *testCase) Setup(t *testing.T) {
}
// Unmount and del.
func
(
self
*
t
estCase
)
Cleanup
()
{
func
(
self
*
stackFsT
estCase
)
Cleanup
()
{
fmt
.
Println
(
"Unmounting."
)
err
:=
self
.
state
.
Unmount
()
if
err
!=
nil
{
...
...
@@ -91,7 +76,7 @@ func (self *testCase) Cleanup() {
////////////////
func
(
self
*
t
estCase
)
testReaddir
()
{
func
(
self
*
stackFsT
estCase
)
testReaddir
()
{
fmt
.
Println
(
"testReaddir... "
)
dir
,
err
:=
os
.
Open
(
self
.
mountDir
,
os
.
O_RDONLY
,
0
)
if
err
!=
nil
{
...
...
@@ -126,7 +111,7 @@ func (self *testCase) testReaddir() {
}
func
(
self
*
t
estCase
)
testSubFs
()
{
func
(
self
*
stackFsT
estCase
)
testSubFs
()
{
fmt
.
Println
(
"testSubFs... "
)
for
i
:=
1
;
i
<=
2
;
i
++
{
// orig := path.Join(self.testDir, fmt.Sprintf("orig%d", i))
...
...
@@ -181,7 +166,7 @@ func (self *testCase) testSubFs() {
}
}
func
(
self
*
t
estCase
)
testAddRemove
()
{
func
(
self
*
stackFsT
estCase
)
testAddRemove
()
{
self
.
tester
.
Log
(
"testAddRemove"
)
attr
:=
fuse
.
Attr
{
Mode
:
0755
,
...
...
@@ -229,10 +214,8 @@ func (self *testCase) testAddRemove() {
}
}
// Test driver.
func
TestMount
(
t
*
testing
.
T
)
{
ts
:=
new
(
testCase
)
func
TestStackFS
(
t
*
testing
.
T
)
{
ts
:=
new
(
stackFsTestCase
)
ts
.
Setup
(
t
)
ts
.
testReaddir
()
...
...
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