File: fuzz_test.go

package info (click to toggle)
golang-collectd 0.3.0%2Bgit20181025.f80706d-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 312 kB
  • sloc: makefile: 3
file content (21 lines) | stat: -rw-r--r-- 339 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// +build gofuzz

package network // import "collectd.org/network"

import (
	"io/ioutil"
	"testing"
)

func TestFuzz(t *testing.T) {
	data, err := ioutil.ReadFile("testdata/packet2.bin")
	if err != nil {
		panic(err)
	}

	got := Fuzz(data)
	if got != 1 {
		t.Errorf("Failed to fuzz a sample packet. Wanted [%v] Got [%v]\n", 1, got)
	}

}