Loading crates/tor-proto/src/channel/circmap.rs +2 −1 Original line number Diff line number Diff line Loading @@ -364,7 +364,8 @@ mod test { #![allow(clippy::needless_pass_by_value)] //! <!-- @@ end test lint list maintained by maint/add_warning @@ --> use super::*; use crate::{client::circuit::padding::new_padding, fake_mpsc}; use crate::circuit::test::fake_mpsc; use crate::client::circuit::padding::new_padding; use tor_basic_utils::test_rng::testing_rng; use tor_rtcompat::DynTimeProvider; Loading crates/tor-proto/src/channel/reactor.rs +1 −1 Original line number Diff line number Diff line Loading @@ -899,9 +899,9 @@ pub(crate) mod test { #![allow(clippy::unwrap_used)] use super::*; use crate::channel::{Canonicity, ChannelMode, ClosedUnexpectedly, UniqId}; use crate::circuit::test::fake_mpsc; use crate::client::circuit::CircParameters; use crate::client::circuit::padding::new_padding; use crate::fake_mpsc; use crate::peer::{PeerAddr, PeerInfo}; use crate::util::{DummyTimeoutEstimator, fake_mq}; use futures::sink::SinkExt; Loading crates/tor-proto/src/circuit.rs +2 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,8 @@ pub(crate) mod test { #[cfg(feature = "relay")] use crate::relay::{CircNetParameters, CongestionControlNetParams}; pub(crate) use super::circ_sender::test::fake_mpsc; /// Return a new [`CircNetParameters`] using default values for unit tests. They are based on /// consensus defaults but should not be considered to be accurate from the one used on the /// production network. Loading crates/tor-proto/src/client/circuit.rs +1 −12 Original line number Diff line number Diff line Loading @@ -85,9 +85,6 @@ use tor_memquota::derive_deftly_template_HasMemoryCost; use crate::crypto::handshake::ntor::NtorPublicKey; #[cfg(test)] use crate::stream::{StreamMpscReceiver, StreamMpscSender}; pub use crate::crypto::binding::CircuitBinding; pub use path::{Path, PathEntry}; Loading Loading @@ -1011,6 +1008,7 @@ pub(crate) mod test { use crate::channel::test::{CodecResult, new_reactor}; use crate::circuit::CircuitRxSender; use crate::circuit::reactor::test::rmsg_to_ccmsg; use crate::circuit::test::fake_mpsc; use crate::client::circuit::padding::new_padding; use crate::client::stream::DataStream; use crate::congestion::params::CongestionControlParams; Loading Loading @@ -1039,7 +1037,6 @@ pub(crate) mod test { }; use tor_cell::relaycell::{RelayMsg, UnparsedRelayMsg}; use tor_linkspec::OwnedCircTarget; use tor_memquota::HasMemoryCost; use tor_rtcompat::Runtime; use tor_rtcompat::SpawnExt; use tracing::trace; Loading Loading @@ -1098,14 +1095,6 @@ pub(crate) mod test { const EXAMPLE_ED_ID: [u8; 32] = [6; 32]; const EXAMPLE_RSA_ID: [u8; 20] = [10; 20]; /// Make an MPSC queue, of the type we use in Channels, but a fake one for testing #[cfg(test)] pub(crate) fn fake_mpsc<T: HasMemoryCost + Debug + Send>( buffer: usize, ) -> (StreamMpscSender<T>, StreamMpscReceiver<T>) { crate::fake_mpsc(buffer) } /// return an example OwnedCircTarget that can get used for an ntor handshake. fn example_target() -> OwnedCircTarget { let mut builder = OwnedCircTarget::builder(); Loading crates/tor-proto/src/relay/reactor.rs +1 −1 Original line number Diff line number Diff line Loading @@ -207,12 +207,12 @@ pub(crate) mod test { use super::*; use crate::circuit::reactor::test::{AllowAllStreamsFilter, rmsg_to_ccmsg}; use crate::circuit::test::fake_mpsc; use crate::circuit::{CircParameters, CircuitRxSender}; use crate::client::circuit::padding::new_padding; use crate::congestion::test_utils::params::build_cc_vegas_params; use crate::crypto::cell::RelayCellBody; use crate::crypto::cell::{InboundRelayLayer, OutboundRelayLayer}; use crate::fake_mpsc; use crate::memquota::SpecificAccount as _; use crate::relay::channel::test::{DummyChan, DummyChanProvider, working_dummy_channel}; use crate::stream::flow_ctrl::params::FlowCtrlParameters; Loading Loading
crates/tor-proto/src/channel/circmap.rs +2 −1 Original line number Diff line number Diff line Loading @@ -364,7 +364,8 @@ mod test { #![allow(clippy::needless_pass_by_value)] //! <!-- @@ end test lint list maintained by maint/add_warning @@ --> use super::*; use crate::{client::circuit::padding::new_padding, fake_mpsc}; use crate::circuit::test::fake_mpsc; use crate::client::circuit::padding::new_padding; use tor_basic_utils::test_rng::testing_rng; use tor_rtcompat::DynTimeProvider; Loading
crates/tor-proto/src/channel/reactor.rs +1 −1 Original line number Diff line number Diff line Loading @@ -899,9 +899,9 @@ pub(crate) mod test { #![allow(clippy::unwrap_used)] use super::*; use crate::channel::{Canonicity, ChannelMode, ClosedUnexpectedly, UniqId}; use crate::circuit::test::fake_mpsc; use crate::client::circuit::CircParameters; use crate::client::circuit::padding::new_padding; use crate::fake_mpsc; use crate::peer::{PeerAddr, PeerInfo}; use crate::util::{DummyTimeoutEstimator, fake_mq}; use futures::sink::SinkExt; Loading
crates/tor-proto/src/circuit.rs +2 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,8 @@ pub(crate) mod test { #[cfg(feature = "relay")] use crate::relay::{CircNetParameters, CongestionControlNetParams}; pub(crate) use super::circ_sender::test::fake_mpsc; /// Return a new [`CircNetParameters`] using default values for unit tests. They are based on /// consensus defaults but should not be considered to be accurate from the one used on the /// production network. Loading
crates/tor-proto/src/client/circuit.rs +1 −12 Original line number Diff line number Diff line Loading @@ -85,9 +85,6 @@ use tor_memquota::derive_deftly_template_HasMemoryCost; use crate::crypto::handshake::ntor::NtorPublicKey; #[cfg(test)] use crate::stream::{StreamMpscReceiver, StreamMpscSender}; pub use crate::crypto::binding::CircuitBinding; pub use path::{Path, PathEntry}; Loading Loading @@ -1011,6 +1008,7 @@ pub(crate) mod test { use crate::channel::test::{CodecResult, new_reactor}; use crate::circuit::CircuitRxSender; use crate::circuit::reactor::test::rmsg_to_ccmsg; use crate::circuit::test::fake_mpsc; use crate::client::circuit::padding::new_padding; use crate::client::stream::DataStream; use crate::congestion::params::CongestionControlParams; Loading Loading @@ -1039,7 +1037,6 @@ pub(crate) mod test { }; use tor_cell::relaycell::{RelayMsg, UnparsedRelayMsg}; use tor_linkspec::OwnedCircTarget; use tor_memquota::HasMemoryCost; use tor_rtcompat::Runtime; use tor_rtcompat::SpawnExt; use tracing::trace; Loading Loading @@ -1098,14 +1095,6 @@ pub(crate) mod test { const EXAMPLE_ED_ID: [u8; 32] = [6; 32]; const EXAMPLE_RSA_ID: [u8; 20] = [10; 20]; /// Make an MPSC queue, of the type we use in Channels, but a fake one for testing #[cfg(test)] pub(crate) fn fake_mpsc<T: HasMemoryCost + Debug + Send>( buffer: usize, ) -> (StreamMpscSender<T>, StreamMpscReceiver<T>) { crate::fake_mpsc(buffer) } /// return an example OwnedCircTarget that can get used for an ntor handshake. fn example_target() -> OwnedCircTarget { let mut builder = OwnedCircTarget::builder(); Loading
crates/tor-proto/src/relay/reactor.rs +1 −1 Original line number Diff line number Diff line Loading @@ -207,12 +207,12 @@ pub(crate) mod test { use super::*; use crate::circuit::reactor::test::{AllowAllStreamsFilter, rmsg_to_ccmsg}; use crate::circuit::test::fake_mpsc; use crate::circuit::{CircParameters, CircuitRxSender}; use crate::client::circuit::padding::new_padding; use crate::congestion::test_utils::params::build_cc_vegas_params; use crate::crypto::cell::RelayCellBody; use crate::crypto::cell::{InboundRelayLayer, OutboundRelayLayer}; use crate::fake_mpsc; use crate::memquota::SpecificAccount as _; use crate::relay::channel::test::{DummyChan, DummyChanProvider, working_dummy_channel}; use crate::stream::flow_ctrl::params::FlowCtrlParameters; Loading