From: Valentine Wallace Date: Tue, 20 Sep 2022 14:08:57 +0000 (-0400) Subject: Rename routing::router::test_utils to ::bench_utils X-Git-Tag: v0.0.112~30^2~1 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=feabd61bfe74be3fb8878d9c4ae2a186e60e61a4;p=rust-lightning Rename routing::router::test_utils to ::bench_utils To disambiguate it from routing::test_utils --- diff --git a/lightning/src/routing/gossip.rs b/lightning/src/routing/gossip.rs index f5c56ce4b..60e3c94f3 100644 --- a/lightning/src/routing/gossip.rs +++ b/lightning/src/routing/gossip.rs @@ -3122,7 +3122,7 @@ mod benches { #[bench] fn read_network_graph(bench: &mut Bencher) { let logger = ::util::test_utils::TestLogger::new(); - let mut d = ::routing::router::test_utils::get_route_file().unwrap(); + let mut d = ::routing::router::bench_utils::get_route_file().unwrap(); let mut v = Vec::new(); d.read_to_end(&mut v).unwrap(); bench.iter(|| { @@ -3133,7 +3133,7 @@ mod benches { #[bench] fn write_network_graph(bench: &mut Bencher) { let logger = ::util::test_utils::TestLogger::new(); - let mut d = ::routing::router::test_utils::get_route_file().unwrap(); + let mut d = ::routing::router::bench_utils::get_route_file().unwrap(); let net_graph = NetworkGraph::read(&mut d, &logger).unwrap(); bench.iter(|| { let _ = net_graph.encode(); diff --git a/lightning/src/routing/router.rs b/lightning/src/routing/router.rs index 523b00eb8..f65757bfd 100644 --- a/lightning/src/routing/router.rs +++ b/lightning/src/routing/router.rs @@ -5314,7 +5314,7 @@ mod tests { fn generate_routes() { use routing::scoring::{ProbabilisticScorer, ProbabilisticScoringParameters}; - let mut d = match super::test_utils::get_route_file() { + let mut d = match super::bench_utils::get_route_file() { Ok(f) => f, Err(e) => { eprintln!("{}", e); @@ -5351,7 +5351,7 @@ mod tests { fn generate_routes_mpp() { use routing::scoring::{ProbabilisticScorer, ProbabilisticScoringParameters}; - let mut d = match super::test_utils::get_route_file() { + let mut d = match super::bench_utils::get_route_file() { Ok(f) => f, Err(e) => { eprintln!("{}", e); @@ -5422,7 +5422,7 @@ mod tests { } #[cfg(all(test, not(feature = "no-std")))] -pub(crate) mod test_utils { +pub(crate) mod bench_utils { use std::fs::File; /// Tries to open a network graph file, or panics with a URL to fetch it. pub(crate) fn get_route_file() -> Result { @@ -5470,7 +5470,7 @@ mod benches { } fn read_network_graph(logger: &DummyLogger) -> NetworkGraph<&DummyLogger> { - let mut d = test_utils::get_route_file().unwrap(); + let mut d = bench_utils::get_route_file().unwrap(); NetworkGraph::read(&mut d, logger).unwrap() }