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
06b9c19b
Commit
06b9c19b
authored
Dec 19, 2016
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TestOutMessageHeader
parent
78a1450a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
1 deletion
+30
-1
internal/buffer/out_message_test.go
internal/buffer/out_message_test.go
+30
-1
No files found.
internal/buffer/out_message_test.go
View file @
06b9c19b
...
...
@@ -8,6 +8,9 @@ import (
"reflect"
"testing"
"unsafe"
"github.com/jacobsa/fuse/internal/fusekernel"
"github.com/kylelemons/godebug/pretty"
)
func
toByteSlice
(
p
unsafe
.
Pointer
,
n
int
)
[]
byte
{
...
...
@@ -180,7 +183,33 @@ func TestOutMessageShrinkTo(t *testing.T) {
}
func
TestOutMessageHeader
(
t
*
testing
.
T
)
{
t
.
Fatal
(
"TODO"
)
var
om
OutMessage
om
.
Reset
()
// Fill in the header.
want
:=
fusekernel
.
OutHeader
{
Len
:
0xdeadbeef
,
Error
:
-
31231917
,
Unique
:
0xcafebabeba5eba11
,
}
h
:=
om
.
OutHeader
()
if
h
==
nil
{
t
.
Fatal
(
"OutHeader returned nil"
)
}
*
h
=
want
// Check that the result is as expected.
b
:=
om
.
Bytes
()
if
len
(
b
)
!=
int
(
unsafe
.
Sizeof
(
want
))
{
t
.
Fatalf
(
"unexpected length %d; want %d"
,
len
(
b
),
unsafe
.
Sizeof
(
want
))
}
got
:=
*
(
*
fusekernel
.
OutHeader
)(
unsafe
.
Pointer
(
&
b
[
0
]))
if
diff
:=
pretty
.
Compare
(
got
,
want
);
diff
!=
""
{
t
.
Errorf
(
"diff -got +want:
\n
%s"
,
diff
)
}
}
func
TestOutMessageReset
(
t
*
testing
.
T
)
{
...
...
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