This crate provides implementations of the Serializer
trait defined by
[fuzzcheck].
There are currently two choices:
ByteSerializer
serializes a Vec<u8>
by directly writing the bits to
a file. You can choose the file extension.SerdeSerializer
uses serde
and serde_json
to serialize any
serde-Serializable
type to a json file.A catch is that SerdeSerializer
is not directly defined in this crate. Instead,
you must use the define_serde_serializer!()
macro in the fuzz-target script to
define it. Like this:
```rust
extern crate fuzzcheck_serializer;
extern crate serde; extern crate serdejson; // serdejson MUST be visible extern crate fuzzcheck; // fuzzcheck MUST be visible
use serde::{Serialize, Deserialize}; // Serializable and Deserializable MUST be visible
// Makes the SerdeSerializer available to fuzzcheck defineserdeserializer!();
fn main() {
// Will mutate values of type Vec
// Test inputs will be encoded with serde_json
let serializer = SerdeSerializer::<Vec<u8>>::default();
// Launch the fuzzing process on the test function
let _ = fuzzcheck::launch(test, mutator, serializer);
} ```