]> Cypherpunks repositories - gostls13.git/commit
[dev.fuzz] testing: convert seed corpus values where possible
authorKatie Hockman <katie@golang.org>
Mon, 7 Jun 2021 21:51:51 +0000 (17:51 -0400)
committerKatie Hockman <katie@golang.org>
Tue, 15 Jun 2021 19:32:21 +0000 (19:32 +0000)
commit413c125da38990720744c0d98ab65c0d5b1602da
tree0e8e9e63f364abc3c00380e092311c621b4a1ce7
parent965b1147549ef28a407bd4e8f5efe5e7b7616f80
[dev.fuzz] testing: convert seed corpus values where possible

The types provided in f.Fuzz will be viewed as the
canonical types for fuzzing. If the type is different
for a seed corpus entry, then the testing package
will attempt to convert it. If it can't convert it,
f.Fuzz will fail.

Currently, this allows converting types that may result
in precision loss or a semantically different value.
For example, an int(-1) can be converted to uint even
though the value could be math.MaxUint64. There is a
TODO to consider improving this in the future.

Updates golang/go#45593

Change-Id: I2e752119662f46b68445d42b1ffa46dd30e9faea
Reviewed-on: https://go-review.googlesource.com/c/go/+/325702
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
src/cmd/go/testdata/script/test_fuzz.txt
src/internal/fuzz/fuzz.go
src/testing/fuzz.go
src/testing/internal/testdeps/deps.go
src/testing/testing.go