Documentation ¶
Index ¶
- func BaseCases(f test.Fuzzer)
- func DeepCopySlow[T any](v T) T
- func Finalize()
- func Fuzz(f test.Fuzzer, ff func(fg Helper))
- func MutateStruct(t test.Failer, st any)
- func Slice[T any](h Helper, count int, validators ...func(T) bool) []T
- func Struct[T any](h Helper, validators ...func(T) bool) T
- type Helper
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BaseCases ¶
BaseCases inserts a few trivial test cases to do a very brief sanity check of a test that relies on []byte inputs
func DeepCopySlow ¶
func DeepCopySlow[T any](v T) T
DeepCopySlow is a general deep copy method that guarantees the correctness of deep copying, but may be very slow. Here, it is only used for testing. Note: this function not support copy struct private filed.
func Finalize ¶
func Finalize()
Finalize works around an issue in the oss-fuzz logic that doesn't allow using Skip() Instead, we send a panic which we handle and treat as skip. https://github.com/AdamKorcz/go-118-fuzz-build/issues/6
func Fuzz ¶
Fuzz is a wrapper around:
fuzz.BaseCases(f) f.Fuzz(func(...) { defer fuzz.Finalizer() }
To avoid needing to call BaseCases and Finalize everywhere.
func MutateStruct ¶
MutateStruct modify the field value of the structure. It is mainly used to check the correctness of the deep copy.