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

Function fuzz_cycle

fuzz/src/bin/tinyvec_drain.rs:51–68  ·  view source on GitHub ↗
(data: &[u8])

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

rand_tinyvecFunction · 0.85
seedFunction · 0.70
as_sliceMethod · 0.45
drainMethod · 0.45

Tested by

no test coverage detected