]> Sergey Matveev's repositories - btrtrc.git/blob - peer_protocol/msg_fuzz_test.go
More optimizations in peer protocol message decoding
[btrtrc.git] / peer_protocol / msg_fuzz_test.go
1 package peer_protocol
2
3 import (
4         "testing"
5
6         qt "github.com/frankban/quicktest"
7 )
8
9 func FuzzMessageMarshalBinary(f *testing.F) {
10         f.Fuzz(func(t *testing.T, b []byte) {
11                 var m Message
12                 if err := m.UnmarshalBinary(b); err != nil {
13                         t.Skip(err)
14                 }
15                 b0 := m.MustMarshalBinary()
16                 qt.Assert(t, b0, qt.DeepEquals, b)
17         })
18 }