File: fuzz_test.go

package info (click to toggle)
golang-github-pion-dtls-v3 3.0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,124 kB
  • sloc: makefile: 4
file content (27 lines) | stat: -rw-r--r-- 563 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
// SPDX-License-Identifier: MIT
package dtls

import (
	"os"
	"testing"
)

func FuzzUnmarshalBinary(f *testing.F) {
	TestResumeClient, err := os.ReadFile("testdata/seed/TestResumeClient.raw")
	if err != nil {
		return
	}
	f.Add(TestResumeClient)

	TestResumeServer, err := os.ReadFile("testdata/seed/TestResumeServer.raw")
	if err != nil {
		return
	}
	f.Add(TestResumeServer)

	f.Fuzz(func(_ *testing.T, data []byte) {
		deserialized := &State{}
		_ = deserialized.UnmarshalBinary(data)
	})
}