diff options
author | Katie Hockman <katie@golang.org> | 2021-09-16 10:03:04 -0400 |
---|---|---|
committer | Katie Hockman <katie@golang.org> | 2021-09-20 17:18:57 +0000 |
commit | 24e25afff457839ddd78b802b42b8fceda0a6904 (patch) | |
tree | 2e7e6dd166e7d63b44b30b383bc9372109fc2c26 /src/cmd/go/testdata/script/test_fuzz.txt | |
parent | 5e9c1fedb69b405b75a0c499e2f32d35f294fd5c (diff) | |
download | go-24e25afff457839ddd78b802b42b8fceda0a6904.tar.gz go-24e25afff457839ddd78b802b42b8fceda0a6904.zip |
[dev.fuzz] Revert "[dev.fuzz] testing: convert seed corpus values where possible"
This reverts commit 413c125da38990720744c0d98ab65c0d5b1602da.
Reason for revert: Giving this more thought, we've decided that
converting types under the hood may cause unexpected behavior to
users. This is a feature that can always be added after more
consideration has been done, but is not something that can be
removed due to the backwards compatibility promise.
Updates golang/go#45593
Change-Id: I79bab24979d7e4c294e6cb6455d4c7729d6a0efb
Reviewed-on: https://go-review.googlesource.com/c/go/+/350251
Trust: Katie Hockman <katie@golang.org>
Trust: Joe Tsai <joetsai@digital-static.net>
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Joe Tsai <joetsai@digital-static.net>
Diffstat (limited to 'src/cmd/go/testdata/script/test_fuzz.txt')
-rw-r--r-- | src/cmd/go/testdata/script/test_fuzz.txt | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/src/cmd/go/testdata/script/test_fuzz.txt b/src/cmd/go/testdata/script/test_fuzz.txt index 3f825c1bc3..b1a02f46eb 100644 --- a/src/cmd/go/testdata/script/test_fuzz.txt +++ b/src/cmd/go/testdata/script/test_fuzz.txt @@ -131,23 +131,11 @@ stdout FAIL ! stdout ^ok stdout FAIL -# Test that converting compatible value from f.Add successful runs cleanly. -go test -run FuzzConvertType fuzz_add_test.go -stdout ^ok -! stdout FAIL - -# Test that converting incompatible value from f.Add fails. -! go test -run FuzzConvertIncompatibleType fuzz_add_test.go +# Test that the wrong type given with f.Add will fail. +! go test -run FuzzWrongType fuzz_add_test.go ! stdout ^ok stdout FAIL -# Test that converts value which would lose precision from f.Add. -# Consider making a test like this fail, as it may have unexpected -# consequences for the developer. -go test -v -run FuzzConvertLosePrecision fuzz_add_test.go -stdout ok -! stdout FAIL - # Test fatal with testdata seed corpus ! go test -run FuzzFail corpustesting/fuzz_testdata_corpus_test.go ! stdout ^ok @@ -391,19 +379,9 @@ func FuzzAddDifferentType(f *testing.F) { f.Fuzz(func(*testing.T, []byte) {}) } -func FuzzConvertIncompatibleType(f *testing.F) { - f.Add("abcde") - f.Fuzz(func(*testing.T, int64) {}) -} - -func FuzzConvertLosePrecision(f *testing.F) { - f.Add(-1) - f.Fuzz(func(*testing.T, uint) {}) -} - -func FuzzConvertType(f *testing.F) { - f.Add(1, "hello") - f.Fuzz(func(*testing.T, uint, []byte) {}) +func FuzzWrongType(f *testing.F) { + f.Add("hello") + f.Fuzz(func(*testing.T, []byte) {}) } -- corpustesting/fuzz_testdata_corpus_test.go -- |