Commit e7174feb authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b111a1c8
...@@ -266,7 +266,14 @@ func TestPktMarshalAllOverflowLightly(t *testing.T) { ...@@ -266,7 +266,14 @@ func TestPktMarshalAllOverflowLightly(t *testing.T) {
// zero-value for a type // zero-value for a type
pkt := reflect.New(typ).Interface().(NEOCodec) pkt := reflect.New(typ).Interface().(NEOCodec)
l := pkt.NEOEncodedLen() l := pkt.NEOEncodedLen()
encoded := strings.Repeat("\x00", l) zerol := make([]byte, l)
testPktMarshal(t, pkt, encoded) // this will turn nil slice & map into empty.
// we need it so that reflect.DeepEqual works for pkt encode/decode comparision
n, err := pkt.NEODecode(zerol)
if !(n == l && err == nil) {
t.Errorf("%v: zero-decode unexpected: %v, %v ; want %v, nil", typ, n, err, l)
}
testPktMarshal(t, pkt, string(zerol))
} }
} }
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