Modules

Fuzz

moduleSource
macOSLinuxWindowswasm

since 0.26.0

#import "Extensions/Fuzz";

Procedures#

RNG#

nextsince 0.26.0
(r: *Rng) -> u64
takesince 0.26.0
(r: *Rng, bytes: s64) -> u64

The next bytes (1 to 8) bytes of the input, or the low bytes of the next seeded value.

belowsince 0.26.0
(r: *Rng, n: s64) -> s64

Uniform in [0, n); 0 when n <= 0. Reads only as many input bytes as n needs.

chancesince 0.26.0
(r: *Rng, one_in: s64) -> bool
case_allocsince 0.26.0
(r: *Rng, bytes: s64) -> *u8

Memory that lives until the end of the case; zeroed, so strings are NUL terminated.

Values#

can_fillsince 0.26.0
(info: *Type_Info) -> bool

Whether fill can produce this type. Callbacks, Any, Type and resizable arrays cannot be built.

has_pointersince 0.26.0
(info: *Type_Info) -> bool

Whether a value of this type contains a pointer, which targets must opt into.

gensince 0.26.0
(r: *Rng, $T: Type) -> T
fillsince 0.26.0
(r: *Rng, info: *Type_Info, dst: *u8)
store_bitssince 0.26.0
(dst: *u8, size: s64, bits: u64)
integer_bitssince 0.26.0
(r: *Rng, size: s64, signed: bool) -> u64

Boundary values come up often because bugs cluster at them.

fill_enumsince 0.26.0
(r: *Rng, info: *Type_Info_Enum, dst: *u8)
fill_arraysince 0.26.0
(r: *Rng, info: *Type_Info_Array, dst: *u8)
gen_lengthsince 0.26.0
(r: *Rng) -> s64

Mostly short, sometimes empty, sometimes as long as allowed.

gen_stringsince 0.26.0
(r: *Rng) -> string

Strings mix well-formed text with the malformed byte runs decoders must reject.

put_malformedsince 0.26.0
(r: *Rng, dst: *u8) -> s64

Writes one malformed sequence of at most four bytes and returns its length.

Types#

Rngstructsince 0.26.0
:: struct

Deterministic random source plus the per-case allocations made while filling values.