std1.0.0-beta-7 SafeC docs

std :: test::fuzz

Struct std::FuzzTarget

#include <std/test/fuzz.h> source

struct FuzzTarget {
    fn void([]const unsigned char) func;
    unsigned long seed;
    unsigned long iters;
}

Fields

§fn void([]const unsigned char) funcsource

the target, called with each input

§unsigned long seedsource

PRNG seed (set before run())

§unsigned long iterssource

number of mutations to try

Methods

§static struct FuzzTarget new(fn void([]const unsigned char) func, unsigned long iters)source · definition

A fuzz target over func with a default seed and iters mutations.

§void run([]const unsigned char corpus)source · definition

Run the fuzzer: start from corpus and apply iters random mutations. Crashes/panics in func are not caught; they surface as normal crashes.