MCPcopy Create free account
hub / github.com/Lokathor/tinyvec / fuzz_cycle

Function fuzz_cycle

fuzz/src/bin/arrayvec_iter.rs:52–71  ·  view source on GitHub ↗
(data: &[u8])

Source from the content-addressed store, hash-verified

50}
51
52fn fuzz_cycle(data: &[u8]) -> Result<(), ()> {
53 use arbitrary::{Arbitrary, Unstructured};
54
55 let mut ring = Unstructured::new(&data);
56
57 let rng = seed(data);
58 let tested = rand_arrvec(rng);
59 let model: Vec<u32> = Vec::from(tested.as_slice());
60
61 let mut tested = tested.into_iter();
62 let mut model = model.into_iter();
63
64 while let Ok(op) = op::Op::arbitrary(&mut ring) {
65 #[cfg(fuzzing_debug)]
66 eprintln!("{:?}", op);
67 op.execute_and_compare(&mut model, &mut tested);
68 }
69
70 Ok(())
71}
72
73fn main() -> Result<(), ()> {
74 //better_panic::install();

Callers

nothing calls this directly

Calls 4

seedFunction · 0.70
rand_arrvecFunction · 0.70
as_sliceMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected