54. Fuzzer

The FUZZER module implements facilities for the fuzz testing.

The idea behind the fuzz testing is to feed random data to the testing function and see if it crashes. panic is considered a valid behavior, and in fact ignored. Fuzz tests work really well in combination with the sanitizers (asan, ubsan, etc).

All functions and symbols are in “fuzzer” module, use require to get access to it.

require daslib/fuzzer

54.1. Fuzzer tests

fuzz(blk: block<> const)

argument

argument type

blk

block<> const

run block however many times ignore panic, so that we can see that runtime crashes

fuzz(fuzz_count: int const; blk: block<> const)

argument

argument type

fuzz_count

int const

blk

block<> const

run block however many times ignore panic, so that we can see that runtime crashes

fuzz_debug(blk: block<> const)

argument

argument type

blk

block<> const

run block however many times do not ignore panic, so that we can see where the runtime fails this is here so that fuzz can be easily replaced with fuzz_debug for the purpose of debugging

fuzz_debug(fuzz_count: int const; blk: block<> const)

argument

argument type

fuzz_count

int const

blk

block<> const

run block however many times do not ignore panic, so that we can see where the runtime fails this is here so that fuzz can be easily replaced with fuzz_debug for the purpose of debugging

fuzz_numeric_and_vector_op1(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes single numeric or vector argument. arguments are: int, uint, float, double, string, int2, int3, int4, uint2, uint3, uint4, float2, float3, float4

fuzz_numeric_and_vector_signed_op1(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes single numeric or vector argument. arguments are: int, uint, float, double, string, int2, int3, int4, uint2, uint3, uint4, float2, float3, float4

fuzz_numeric_op1(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes single numeric or vector argument. arguments are: int, uint, float, double

fuzz_numeric_and_storage_op1(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes single numeric or vector argument. arguments are: int, uint, int8, uint8, int16, uint16, int64, uint64, float, double

fuzz_all_ints_op1(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes single numeric or vector argument. arguments are: int, uint, int64, uint64

fuzz_all_unsigned_ints_op1(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes single numeric or vector argument. arguments are: uint, uint64

fuzz_float_double_or_float_vec_op1(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes single numeric or vector argument. arguments are: float, double, float2, float3, float4

fuzz_float_or_float_vec_op1(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes single numeric or vector argument. arguments are: float, float2, float3, float4

fuzz_float_or_float_vec_op2(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes two numeric or vector arguments. arguments are: float, float2, float3, float4

fuzz_float_double_or_float_vec_op2(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes two numeric or vector arguments. arguments are: float, double, float2, float3, float4

fuzz_numeric_and_vector_op2(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes two numeric or vector arguments. arguments are: int, uint, float, double, int2, int3, int4, uint2, uint3, uint4, float2, float3, float4

fuzz_numeric_and_vector_op2_no_unint_vec(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes two numeric or vector arguments. arguments are: int, uint, float, double, int2, int3, int4, float2, float3, float4

fuzz_numeric_op2(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes two numeric or vector arguments. arguments are: int, uint, float, double

fuzz_compareable_op2(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes two numeric or vector arguments. arguments are: int, uint, float, double, int64, uint64, string

fuzz_eq_neq_op2(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes two numeric or vector arguments. arguments are: int, uint, int64, uint64, float, double, string, int2, int3, int4, uint2, uint3, uint4, float2, float3, float4

fuzz_numeric_vec_scal_op2(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes vector and matching scalar on the right arguments pairs are: int2,int; int3,int; uint2,uint; uint3,uint; uint4,uint; int4,int; float2,float; float3,float; float4,float

fuzz_numeric_scal_vec_op2(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes vector and matching scalar on the left arguments pairs are: int2,int; int3,int; uint2,uint; uint3,uint; uint4,uint; int4,int; float2,float; float3,float; float4,float

fuzz_int_vector_op2(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes two numeric or vector arguments. arguments are: int, uint, int2, int3, int4, uint2, uint3, uint4

fuzz_shift_op2(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes numeric or vector argument, with matching shift type on the right. arguments are: int, uint, int2, int3, int4, uint2, uint3, uint4

fuzz_rotate_op2(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes numeric or vector argument, with matching rotate type on the right. arguments are: int, uint

fuzz_numeric_op3(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes three numeric or vector arguments. arguments are: int, uint, float, double

fuzz_vec_op3(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes three numeric or vector arguments. arguments are: float2, float3, float4, int2, int3, int4, uint2, uint3, uint4

fuzz_vec_mad_op3(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes three numeric or vector arguments. arguments are: float2, float3, float4, int2, int3, int4, uint2, uint3, uint4 second argument is float, int, uint accordingly

fuzz_float_double_or_float_vec_op3(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes three numeric or vector arguments. arguments are: float, double, float2, float3, float4

fuzz_numeric_op4(t: T? const; fake: Faker; funcname: string const)

argument

argument type

t

testing::T ? const

fake

faker::Faker

funcname

string const

fuzzes generic function that takes four numeric or vector arguments. arguments are: int, uint, float, double