Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
4db15124
Commit
4db15124
authored
Sep 03, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X empty Address test case
parent
0a79d8c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
go/neo/connection.go
go/neo/connection.go
+2
-2
go/neo/proto_test.go
go/neo/proto_test.go
+9
-1
No files found.
go/neo/connection.go
View file @
4db15124
...
@@ -800,7 +800,7 @@ func (nl *NodeLink) recvPkt() (*PktBuf, error) {
...
@@ -800,7 +800,7 @@ func (nl *NodeLink) recvPkt() (*PktBuf, error) {
}
}
}
}
if
/* XXX temp show only tx */
fals
e
&&
dumpio
{
if
/* XXX temp show only tx */
tru
e
&&
dumpio
{
// XXX -> log
// XXX -> log
fmt
.
Printf
(
"%v < %v: %v
\n
"
,
nl
.
peerLink
.
LocalAddr
(),
nl
.
peerLink
.
RemoteAddr
(),
pkt
)
fmt
.
Printf
(
"%v < %v: %v
\n
"
,
nl
.
peerLink
.
LocalAddr
(),
nl
.
peerLink
.
RemoteAddr
(),
pkt
)
}
}
...
@@ -1147,7 +1147,7 @@ func (c *Conn) Recv() (Msg, error) {
...
@@ -1147,7 +1147,7 @@ func (c *Conn) Recv() (Msg, error) {
msg
:=
reflect
.
New
(
msgType
)
.
Interface
()
.
(
Msg
)
msg
:=
reflect
.
New
(
msgType
)
.
Interface
()
.
(
Msg
)
_
,
err
=
msg
.
neoMsgDecode
(
pkt
.
Payload
())
_
,
err
=
msg
.
neoMsgDecode
(
pkt
.
Payload
())
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
&
ConnError
{
Conn
:
c
,
Op
:
"decode"
,
Err
:
err
}
return
nil
,
&
ConnError
{
Conn
:
c
,
Op
:
"decode"
,
Err
:
err
}
// XXX "decode:" is already in ErrDecodeOverflow
}
}
traceConnRecv
(
c
,
msg
)
traceConnRecv
(
c
,
msg
)
...
...
go/neo/proto_test.go
View file @
4db15124
...
@@ -250,6 +250,15 @@ func TestMsgMarshal(t *testing.T) {
...
@@ -250,6 +250,15 @@ func TestMsgMarshal(t *testing.T) {
hex
(
"3fbf9add1091c895"
),
hex
(
"3fbf9add1091c895"
),
},
},
// float64, empty Address, int32
{
&
NotifyNodeInformation
{
1504466245.926185
,
[]
NodeInfo
{
{
CLIENT
,
Address
{},
UUID
(
CLIENT
,
1
),
RUNNING
,
1504466245.925599
}}},
hex
(
"41d66b15517b469d"
)
+
u32
(
1
)
+
u32
(
2
)
+
u32
(
0
)
/* <- ø Address */
+
hex
(
"e0000001"
)
+
u32
(
2
)
+
hex
(
"41d66b15517b3d04"
),
},
// TODO we need tests for:
// TODO we need tests for:
// []varsize + trailing
// []varsize + trailing
// map[]varsize + trailing
// map[]varsize + trailing
...
@@ -257,7 +266,6 @@ func TestMsgMarshal(t *testing.T) {
...
@@ -257,7 +266,6 @@ func TestMsgMarshal(t *testing.T) {
// TODO special cases for:
// TODO special cases for:
// - float64 (+ nan !nan ...)
// - float64 (+ nan !nan ...)
// - Address,
}
}
for
_
,
tt
:=
range
testv
{
for
_
,
tt
:=
range
testv
{
...
...
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