fuzz: fix fuzz warnings (#5614)

This commit is contained in:
Iron(III) Oxide
2023-04-13 16:07:12 +02:00
committed by GitHub
parent cf9a03c107
commit abc93f615e
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -658,5 +658,6 @@ cfg_macros! {
#[cfg(test)]
fn is_unpin<T: Unpin>() {}
/// fuzz test (fuzz_linked_list)
#[cfg(fuzzing)]
pub mod fuzz;
+3
View File
@@ -507,6 +507,7 @@ pub(crate) mod tests {
}
}
#[cfg(test)]
macro_rules! assert_clean {
($e:ident) => {{
assert!($e.pointers.get_next().is_none());
@@ -514,6 +515,7 @@ pub(crate) mod tests {
}};
}
#[cfg(test)]
macro_rules! assert_ptr_eq {
($a:expr, $b:expr) => {{
// Deal with mapping a Pin<&mut T> -> Option<NonNull<T>>
@@ -717,6 +719,7 @@ pub(crate) mod tests {
}
}
/// This is a fuzz test. You run it by entering `cargo fuzz run fuzz_linked_list` in CLI in `/tokio/` module.
#[cfg(fuzzing)]
pub fn fuzz_linked_list(ops: &[u8]) {
enum Op {