#[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(|| {
#[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();
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);
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);
}
#[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<std::fs::File, &'static str> {
}
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()
}