]> Cypherpunks repositories - gostls13.git/commit
[dev.fuzz] testing: move inFuzzFn checks from common to F
authorJay Conrod <jayconrod@google.com>
Tue, 9 Feb 2021 22:32:08 +0000 (17:32 -0500)
committerJay Conrod <jayconrod@google.com>
Wed, 10 Feb 2021 18:33:14 +0000 (18:33 +0000)
commit25bd2e962e33d15922111464311c4a94ec910773
tree9585dd8ea2f58078275239839129fccc6f0d697a
parent1b5cf71ccf0dc95f121830cfdad8280c4f6c1f28
[dev.fuzz] testing: move inFuzzFn checks from common to F

inFuzzFn is set when the fuzz function is called. While it's set,
F methods that have side effects like Skip and Fail may not be called.

Previously, (CL 259657) inFuzzFn was in common, and we checked it in
the common implementation of those methods. This causes problems in
CL 290693 for recursive methods like common.Fail. If T.Fail is
called by the fuzz function, it calls common.Fail on the parent F's
common. That should not panic.

Change-Id: I841b12f77d9c77f5021370d03313e71b4ef50102
Reviewed-on: https://go-review.googlesource.com/c/go/+/290811
Trust: Jay Conrod <jayconrod@google.com>
Trust: Katie Hockman <katie@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
src/testing/fuzz.go
src/testing/testing.go