Commit 4db15124 authored by Kirill Smelkov's avatar Kirill Smelkov

X empty Address test case

parent 0a79d8c7
......@@ -800,7 +800,7 @@ func (nl *NodeLink) recvPkt() (*PktBuf, error) {
}
}
if /* XXX temp show only tx */ false && dumpio {
if /* XXX temp show only tx */ true && dumpio {
// XXX -> log
fmt.Printf("%v < %v: %v\n", nl.peerLink.LocalAddr(), nl.peerLink.RemoteAddr(), pkt)
}
......@@ -1147,7 +1147,7 @@ func (c *Conn) Recv() (Msg, error) {
msg := reflect.New(msgType).Interface().(Msg)
_, err = msg.neoMsgDecode(pkt.Payload())
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)
......
......@@ -250,6 +250,15 @@ func TestMsgMarshal(t *testing.T) {
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:
// []varsize + trailing
// map[]varsize + trailing
......@@ -257,7 +266,6 @@ func TestMsgMarshal(t *testing.T) {
// TODO special cases for:
// - float64 (+ nan !nan ...)
// - Address,
}
for _, tt := range testv {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment