Files
noq/fuzz/fuzz_targets/streamid.rs
Rüdiger Klaehn feeafe40c9 Disable fuzz code unless fuzzing config is set (#309)
With this we no longer get compile errors in vscode because the fuzzing
code uses fns that are themselves gated with cfg(fuzzing).

We have to tell rust about the feature in Cargo.toml to avoid warnings.
2026-01-13 09:20:49 +00:00

21 lines
423 B
Rust

#![no_main]
#![cfg(fuzzing)]
use arbitrary::Arbitrary;
use libfuzzer_sys::fuzz_target;
extern crate proto;
use proto::{Dir, Side, StreamId};
#[derive(Arbitrary, Debug)]
struct StreamIdParams {
side: Side,
dir: Dir,
index: u64,
}
fuzz_target!(|data: StreamIdParams| {
let s = StreamId::new(data.side, data.dir, data.index);
assert_eq!(s.initiator(), data.side);
assert_eq!(s.dir(), data.dir);
});