summaryrefslogtreecommitdiff
path: root/daemon/logger/jsonfilelog/jsonlog/fuzz_test.go
blob: fcade0e895205debbfb34ab6b3ef7d7279c51001 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package jsonlog

import (
	"bytes"
	"testing"

	fuzz "github.com/AdaLogics/go-fuzz-headers"
)

func FuzzJSONLogsMarshalJSONBuf(f *testing.F) {
	f.Fuzz(func(t *testing.T, data []byte) {
		ff := fuzz.NewConsumer(data)
		l := &JSONLogs{}
		err := ff.GenerateStruct(l)
		if err != nil {
			return
		}
		var buf bytes.Buffer
		l.MarshalJSONBuf(&buf)
	})
}