macro_rules! fuzz { (|$buf:ident| $body:block) => { ... }; (|$buf:ident: &[u8]| $body:block) => { ... }; (|$buf:ident: $dty: ty| $body:block) => { ... }; }
Expand description
Fuzz a closure-like block of code by passing an object of arbitrary type.
It can handle different types of arguments for the harness closure, including Arbitrary.
See our examples.
ziggy::fuzz!(|data: &[u8]| {
if data.len() != 6 {return}
if data[0] != b'q' {return}
if data[1] != b'w' {return}
if data[2] != b'e' {return}
if data[3] != b'r' {return}
if data[4] != b't' {return}
if data[5] != b'y' {return}
panic!("BOOM")
});