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
76730696
Commit
76730696
authored
Oct 07, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Suppress log messages of handle_test.
parent
a8d84251
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
fuse/handle_test.go
fuse/handle_test.go
+7
-6
No files found.
fuse/handle_test.go
View file @
76730696
...
...
@@ -6,12 +6,13 @@ import (
"testing"
"unsafe"
)
var
_
=
log
.
Println
func
markSeen
(
substr
string
)
{
func
markSeen
(
t
*
testing
.
T
,
substr
string
)
{
if
r
:=
recover
();
r
!=
nil
{
s
:=
r
.
(
string
)
if
strings
.
Contains
(
s
,
substr
)
{
log
.
Println
(
"expected recovery from: "
,
r
)
t
.
Log
(
"expected recovery from: "
,
r
)
}
else
{
panic
(
s
)
}
...
...
@@ -24,7 +25,7 @@ func TestHandleMapDoubleRegister(t *testing.T) {
return
}
t
.
Log
(
"TestDoubleRegister"
)
defer
markSeen
(
"already has a handle"
)
defer
markSeen
(
t
,
"already has a handle"
)
hm
:=
NewHandleMap
(
false
)
obj
:=
&
Handled
{}
hm
.
Register
(
obj
,
obj
)
...
...
@@ -44,7 +45,7 @@ func TestHandleMapUnaligned(t *testing.T) {
b
:=
make
([]
byte
,
100
)
v
:=
(
*
Handled
)(
unsafe
.
Pointer
(
&
b
[
1
]))
defer
markSeen
(
"unaligned"
)
defer
markSeen
(
t
,
"unaligned"
)
hm
.
Register
(
v
,
v
)
t
.
Error
(
"Unaligned register did not panic"
)
}
...
...
@@ -59,7 +60,7 @@ func TestHandleMapPointerLayout(t *testing.T) {
bogus
:=
uint64
(
1
)
<<
uint32
((
8
*
(
unsafe
.
Sizeof
(
t
)
-
1
)))
p
:=
uintptr
(
bogus
)
v
:=
(
*
Handled
)(
unsafe
.
Pointer
(
p
))
defer
markSeen
(
"48"
)
defer
markSeen
(
t
,
"48"
)
hm
.
Register
(
v
,
v
)
t
.
Error
(
"bogus register did not panic"
)
}
...
...
@@ -111,7 +112,7 @@ func TestHandleMapCheckFail(t *testing.T) {
t
.
Log
(
"skipping test for 32 bits"
)
return
}
defer
markSeen
(
"check mismatch"
)
defer
markSeen
(
t
,
"check mismatch"
)
v
:=
new
(
Handled
)
hm
:=
NewHandleMap
(
false
)
...
...
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