diff options
| author | Luqman Aden <laden@csclub.uwaterloo.ca> | 2014-01-22 16:05:28 -0500 |
|---|---|---|
| committer | Luqman Aden <laden@csclub.uwaterloo.ca> | 2014-01-24 16:44:16 -0500 |
| commit | a04cc4db2c077fd2fcf6e5bcca92eecb3cfa8380 (patch) | |
| tree | 08c0ae2c6e3cc3c7c75e052288c8771bab0ac62a /src/libstd/io | |
| parent | 5aa31c43a0ab50208e58680cf5f29eec8ff76357 (diff) | |
| download | rust-a04cc4db2c077fd2fcf6e5bcca92eecb3cfa8380.tar.gz rust-a04cc4db2c077fd2fcf6e5bcca92eecb3cfa8380.zip | |
libstd: Use iotest! for for get_host_addresses.
Diffstat (limited to 'src/libstd/io')
| -rw-r--r-- | src/libstd/io/net/addrinfo.rs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/libstd/io/net/addrinfo.rs b/src/libstd/io/net/addrinfo.rs index fe29a112262..4a8529d0a0a 100644 --- a/src/libstd/io/net/addrinfo.rs +++ b/src/libstd/io/net/addrinfo.rs @@ -98,15 +98,15 @@ fn lookup(hostname: Option<&str>, servname: Option<&str>, hint: Option<Hint>) LocalIo::maybe_raise(|io| io.get_host_addresses(hostname, servname, hint)) } -#[cfg(test)] +// Ignored on android since we cannot give tcp/ip +// permission without help of apk +#[cfg(test, not(target_os = "android"))] mod test { use io::net::ip::Ipv4Addr; use prelude::*; use super::*; - #[test] - #[ignore(cfg(target_os="android"))] // cannot give tcp/ip permission without help of apk - fn dns_smoke_test() { + iotest!(fn dns_smoke_test() { let ipaddrs = get_host_addresses("localhost").unwrap(); let mut found_local = false; let local_addr = &Ipv4Addr(127, 0, 0, 1); @@ -114,5 +114,11 @@ mod test { found_local = found_local || addr == local_addr; } assert!(found_local); - } + }) + + iotest!(fn issue_10663() { + // Something should happen here, but this certainly shouldn't cause + // everything to die. The actual outcome we don't care too much about. + get_host_addresses("example.com"); + } #[ignore]) } |
