diff options
| author | Eric Reed <ereed@mozilla.com> | 2013-07-02 16:40:57 -0700 |
|---|---|---|
| committer | Eric Reed <ereed@mozilla.com> | 2013-07-02 16:40:57 -0700 |
| commit | e6c57793be2cf7aabfa96aeada77935cc0351067 (patch) | |
| tree | f2f4dcb8a4b3b32e692dbfb549024e3c1e9fa580 /src/libstd/rt/test.rs | |
| parent | 42f3f069fa1963cdf19117e57a83089889a64f37 (diff) | |
| download | rust-e6c57793be2cf7aabfa96aeada77935cc0351067.tar.gz rust-e6c57793be2cf7aabfa96aeada77935cc0351067.zip | |
IPv6 support for UDP and TCP.
Diffstat (limited to 'src/libstd/rt/test.rs')
| -rw-r--r-- | src/libstd/rt/test.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libstd/rt/test.rs b/src/libstd/rt/test.rs index b0e49684014..e1b338e2cad 100644 --- a/src/libstd/rt/test.rs +++ b/src/libstd/rt/test.rs @@ -17,7 +17,7 @@ use iterator::IteratorUtil; use vec::{OwnedVector, MutableVector}; use result::{Result, Ok, Err}; use unstable::run_in_bare_thread; -use super::io::net::ip::{IpAddr, Ipv4}; +use super::io::net::ip::{IpAddr, Ipv4, Ipv6}; use rt::comm::oneshot; use rt::task::Task; use rt::thread::Thread; @@ -405,11 +405,16 @@ pub fn next_test_port() -> u16 { } } -/// Get a unique localhost:port pair starting at 9600 +/// Get a unique IPv4 localhost:port pair starting at 9600 pub fn next_test_ip4() -> IpAddr { Ipv4(127, 0, 0, 1, next_test_port()) } +/// Get a unique IPv6 localhost:port pair starting at 9600 +pub fn next_test_ip6() -> IpAddr { + Ipv6(0, 0, 0, 0, 0, 0, 0, 1, next_test_port()) +} + /// Get a constant that represents the number of times to repeat stress tests. Default 1. pub fn stress_factor() -> uint { use os::getenv; |
