]> Cypherpunks repositories - gostls13.git/commit
[dev.fuzz] internal/fuzz: refactor byte slice mutators
authorRoland Shoemaker <roland@golang.org>
Thu, 17 Jun 2021 18:54:10 +0000 (11:54 -0700)
committerRoland Shoemaker <roland@golang.org>
Tue, 22 Jun 2021 04:10:24 +0000 (04:10 +0000)
commitff6f2051d9151a03d012c3020c62f3574e1b2d1b
tree052fbdf0ca192608063bff8b65a42c7469b01e5d
parent413c125da38990720744c0d98ab65c0d5b1602da
[dev.fuzz] internal/fuzz: refactor byte slice mutators

Move all byte slice mutators into their own functions and randomly pick
from a slice, rather than using a large switch statement. Additionally
tests are added for each mutator which, lightly, test that they are
working as intended.

Other type mutators are left as-is for a similar refactor in the future.

Change-Id: Ifd4447b885885b3cc068748f33cc5d1ea25af62f
Reviewed-on: https://go-review.googlesource.com/c/go/+/329089
Trust: Roland Shoemaker <roland@golang.org>
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/internal/fuzz/mutator.go
src/internal/fuzz/mutators_byteslice.go [new file with mode: 0644]
src/internal/fuzz/mutators_byteslice_test.go [new file with mode: 0644]
src/internal/fuzz/pcg.go