From: Katie Hockman Date: Mon, 22 Feb 2021 18:25:07 +0000 (-0500) Subject: [dev.fuzz] internal/fuzz: updating version incoding X-Git-Tag: go1.18beta1~1282^2~89 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5aacd47c002c39b481c4c7a0663e851758da372a;p=gostls13.git [dev.fuzz] internal/fuzz: updating version incoding Based on feedback from rsc@, update the version encoding to more clearly indicate that this is about fuzzing with Go. Change-Id: Id95dec8283608779b157bf662e7147f9a9c8dba8 Reviewed-on: https://go-review.googlesource.com/c/go/+/295110 Trust: Katie Hockman Run-TryBot: Katie Hockman Reviewed-by: Jay Conrod --- diff --git a/src/internal/fuzz/encoding.go b/src/internal/fuzz/encoding.go index f9403b36bc..31810fca61 100644 --- a/src/internal/fuzz/encoding.go +++ b/src/internal/fuzz/encoding.go @@ -14,7 +14,7 @@ import ( ) // encVersion1 will be the first line of a file with version 1 encoding. -var encVersion1 = "version 1" +var encVersion1 = "go test fuzz v1" // marshalCorpusFile encodes an arbitrary number of arguments into the file format for the // corpus. diff --git a/src/internal/fuzz/encoding_test.go b/src/internal/fuzz/encoding_test.go index 98d3e21c1f..cbf4999f8d 100644 --- a/src/internal/fuzz/encoding_test.go +++ b/src/internal/fuzz/encoding_test.go @@ -19,59 +19,59 @@ func TestUnmarshalMarshal(t *testing.T) { ok: false, // missing version }, { - in: `version 1 + in: `go test fuzz v1 string("a"bcad")`, ok: false, // malformed }, { - in: `version 1 + in: `go test fuzz v1 int()`, ok: false, // empty value }, { - in: `version 1 + in: `go test fuzz v1 uint(-32)`, ok: false, // invalid negative uint }, { - in: `version 1 + in: `go test fuzz v1 int8(1234456)`, ok: false, // int8 too large }, { - in: `version 1 + in: `go test fuzz v1 int(20*5)`, ok: false, // expression in int value }, { - in: `version 1 + in: `go test fuzz v1 int(--5)`, ok: false, // expression in int value }, { - in: `version 1 + in: `go test fuzz v1 bool(0)`, ok: false, // malformed bool }, { - in: `version 1 + in: `go test fuzz v1 byte('aa)`, ok: false, // malformed byte }, { - in: `version 1 + in: `go test fuzz v1 byte('☃')`, ok: false, // byte out of range }, { - in: `version 1 + in: `go test fuzz v1 string("extra") []byte("spacing") `, ok: true, }, { - in: `version 1 + in: `go test fuzz v1 int(-23) int8(-2) int64(2342425)