Skip to content

Commit

Permalink
Remove unused test
Browse files Browse the repository at this point in the history
  • Loading branch information
dlon committed Dec 12, 2024
1 parent 20931c2 commit 6546f77
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions talpid-wireguard/src/wireguard_go/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,36 +486,6 @@ impl Tunnel for WgGoTunnel {
}
}

#[cfg(daita)]
fn load_maybenot_machines(resource_dir: &Path) -> Result<CString> {
let path = resource_dir.join("maybenot_machines");
log::debug!("Reading maybenot machines from {}", path.display());

let machines = fs::read_to_string(path).map_err(|e| TunnelError::StartDaita(Box::new(e)))?;
let machines = CString::new(machines).map_err(|e| TunnelError::StartDaita(Box::new(e)))?;
Ok(machines)
}

#[cfg(test)]
mod test {
/// Test whether `maybenot_machines` in dist-assets contains valid machines.
/// TODO: Remove when switching to dynamic machines.
#[cfg(daita)]
#[test]
fn test_load_maybenot_machines() {
use super::load_maybenot_machines;
use std::path::PathBuf;

let dist_assets = std::env::var("CARGO_MANIFEST_DIR")
.map(PathBuf::from)
.expect("CARGO_MANIFEST_DIR env var not set")
.join("..")
.join("dist-assets");
let machines = load_maybenot_machines(&dist_assets).unwrap();
wireguard_go_rs::validate_maybenot_machines(&machines).unwrap();
}
}

mod stats {
use super::{Stats, StatsMap};

Expand Down

0 comments on commit 6546f77

Please sign in to comment.