...

Package fuzz

import "github.com/klauspost/compress/internal/fuzz"
Overview
Index

Overview ▾

Package fuzz provides a way to add test cases to a testing.F instance from a zip file.

func AddFromZip

func AddFromZip(f *testing.F, filename string, t InputType, short bool)

AddFromZip will read the supplied zip and add all as corpus for f. Byte slices only.

func ReturnFromZip

func ReturnFromZip(tb testing.TB, filename string, t InputType, fn func([]byte))

ReturnFromZip will read the supplied zip and add all as corpus for f. Byte slices only.

type InputType

type InputType uint8
const (
    // TypeRaw indicates that files are raw bytes.
    TypeRaw InputType = iota
    // TypeGoFuzz indicates files are from Go Fuzzer.
    TypeGoFuzz
    // TypeOSSFuzz indicates that files are from OSS fuzzer with size before data.
    TypeOSSFuzz
)