nix/test/test_net.rs
SteveLauC 6961f0fabd
refactor: cfg for test/* (#2230)
* refactor: cfg for test/*

* one more netbsdlike

* more cfg
2023-12-09 16:15:41 +00:00

16 lines
319 B
Rust

use nix::net::if_::*;
#[cfg(linux_android)]
const LOOPBACK: &[u8] = b"lo";
#[cfg(not(any(linux_android, target_os = "haiku")))]
const LOOPBACK: &[u8] = b"lo0";
#[cfg(target_os = "haiku")]
const LOOPBACK: &[u8] = b"loop";
#[test]
fn test_if_nametoindex() {
if_nametoindex(LOOPBACK).expect("assertion failed");
}