]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.fuzz] internal/fuzz: updating version incoding
authorKatie Hockman <katie@golang.org>
Mon, 22 Feb 2021 18:25:07 +0000 (13:25 -0500)
committerKatie Hockman <katie@golang.org>
Mon, 22 Feb 2021 18:50:34 +0000 (18:50 +0000)
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 <katie@golang.org>
Run-TryBot: Katie Hockman <katie@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/internal/fuzz/encoding.go
src/internal/fuzz/encoding_test.go

index f9403b36bcc9293f5dc6b37678b65275decd3cbf..31810fca618144511909408c5adf347124b1563a 100644 (file)
@@ -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.
index 98d3e21c1f96970bab87e1e83390e4e928849a64..cbf4999f8db9ea2d8e2384f3319d670d9cff2572 100644 (file)
@@ -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)