From abc93f615e1fa0bfcd7a2650343bbe562ef95e3f Mon Sep 17 00:00:00 2001 From: "Iron(III) Oxide" <83634595+amab8901@users.noreply.github.com> Date: Thu, 13 Apr 2023 16:07:12 +0200 Subject: [PATCH] fuzz: fix fuzz warnings (#5614) --- tokio/src/lib.rs | 1 + tokio/src/util/linked_list.rs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/tokio/src/lib.rs b/tokio/src/lib.rs index 688dd0c4d42..96da4b777d3 100644 --- a/tokio/src/lib.rs +++ b/tokio/src/lib.rs @@ -658,5 +658,6 @@ cfg_macros! { #[cfg(test)] fn is_unpin() {} +/// fuzz test (fuzz_linked_list) #[cfg(fuzzing)] pub mod fuzz; diff --git a/tokio/src/util/linked_list.rs b/tokio/src/util/linked_list.rs index 460e2564d4e..6bf26818423 100644 --- a/tokio/src/util/linked_list.rs +++ b/tokio/src/util/linked_list.rs @@ -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> @@ -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 {