]> git.lizzy.rs Git - rust.git/commitdiff
Fix test fallout
authorBrian Anderson <banderson@mozilla.com>
Wed, 13 Aug 2014 22:26:48 +0000 (15:26 -0700)
committerBrian Anderson <banderson@mozilla.com>
Wed, 13 Aug 2014 22:26:48 +0000 (15:26 -0700)
src/test/run-pass/tcp-connect-timeouts.rs
src/test/run-pass/tcp-stress.rs

index 5519963693d7a96bc7313bd4cdfc5c2279442eb1..c1d93033ab6fea9ef85430d51f413c7e30c91402 100644 (file)
@@ -99,11 +99,11 @@ fn f() $b
 
     iotest!(fn connect_timeout_zero() {
         let addr = next_test_ip4();
-        assert!(TcpStream::connect_timeout(&addr, Duration::milliseconds(0)).is_err());
+        assert!(TcpStream::connect_timeout(addr, Duration::milliseconds(0)).is_err());
     })
 
     iotest!(fn connect_timeout_negative() {
         let addr = next_test_ip4();
-        assert!(TcpStream::connect_timeout(&addr, Duration::milliseconds(-1)).is_err());
+        assert!(TcpStream::connect_timeout(addr, Duration::milliseconds(-1)).is_err());
     })
 
index f52a3455e4157684c16b98c5b29828db88b4f125..864d005f37344a710c85e78afc514fcea1d17de5 100644 (file)
@@ -23,6 +23,7 @@
 use std::io::net::tcp::{TcpListener, TcpStream};
 use std::io::{Acceptor, Listener};
 use std::task::TaskBuilder;
+use std::time::Duration;
 
 #[start]
 fn start(argc: int, argv: *const *const u8) -> int {
@@ -33,7 +34,7 @@ fn main() {
     // This test has a chance to time out, try to not let it time out
     spawn(proc() {
         use std::io::timer;
-        timer::sleep(30 * 1000);
+        timer::sleep(Duration::milliseconds(30 * 1000));
         println!("timed out!");
         unsafe { libc::exit(1) }
     });