peer_protocol/decoder_fuzz_test.go => peer_protocol/fuzz_test.go | 13 +++++++++++++ peer_protocol/msg_fuzz_test.go | 18 ------------------ diff --git a/peer_protocol/decoder_fuzz_test.go b/peer_protocol/fuzz_test.go rename from peer_protocol/decoder_fuzz_test.go rename to peer_protocol/fuzz_test.go index 2fd357e40f3e1c7ac1d7c8f701b5532f6c187c6f..2c92c70c227d562e7c4e78bbd397eb78794850cf 100644 --- a/peer_protocol/decoder_fuzz_test.go +++ b/peer_protocol/fuzz_test.go @@ -1,3 +1,5 @@ +//go:build go1.18 + package peer_protocol import ( @@ -43,3 +45,14 @@ } c.Assert(buf.Bytes(), qt.DeepEquals, b) }) } + +func FuzzMessageMarshalBinary(f *testing.F) { + f.Fuzz(func(t *testing.T, b []byte) { + var m Message + if err := m.UnmarshalBinary(b); err != nil { + t.Skip(err) + } + b0 := m.MustMarshalBinary() + qt.Assert(t, b0, qt.DeepEquals, b) + }) +} diff --git a/peer_protocol/msg_fuzz_test.go b/peer_protocol/msg_fuzz_test.go deleted file mode 100644 index 9e214b304bf3dabacac7dd1fcd722a7b8faf6676..0000000000000000000000000000000000000000 --- a/peer_protocol/msg_fuzz_test.go +++ /dev/null @@ -1,18 +0,0 @@ -package peer_protocol - -import ( - "testing" - - qt "github.com/frankban/quicktest" -) - -func FuzzMessageMarshalBinary(f *testing.F) { - f.Fuzz(func(t *testing.T, b []byte) { - var m Message - if err := m.UnmarshalBinary(b); err != nil { - t.Skip(err) - } - b0 := m.MustMarshalBinary() - qt.Assert(t, b0, qt.DeepEquals, b) - }) -}