Fixed other tests to pass make check

This commit is contained in:
Vladimir Matveev 2014-10-30 23:22:40 +03:00
parent 7e3344b17f
commit 7d379fa78f
7 changed files with 12 additions and 22 deletions

View File

@ -444,7 +444,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
//waiting 1 second for gdbserver start
timer::sleep(Duration::milliseconds(1000));
let result = task::try(proc() {
tcp::TcpStream::connect("127.0.0.1", 5039).unwrap();
tcp::TcpStream::connect("127.0.0.1:5039").unwrap();
});
if result.is_err() {
continue;

View File

@ -91,7 +91,7 @@ Some examples of obvious things you might want to do
# // locally, we still want to be type checking this code, so lets
# // just stop it running (#11576)
# if false {
let mut socket = TcpStream::connect("127.0.0.1", 8080).unwrap();
let mut socket = TcpStream::connect("127.0.0.1:8080").unwrap();
socket.write(b"GET / HTTP/1.0\n\n");
let response = socket.read_to_end();
# }
@ -106,7 +106,7 @@ Some examples of obvious things you might want to do
use std::io::{TcpListener, TcpStream};
use std::io::{Acceptor, Listener};
let listener = TcpListener::bind("127.0.0.1", 80);
let listener = TcpListener::bind("127.0.0.1:80");
// bind the listener to the specified address
let mut acceptor = listener.listen();

View File

@ -20,18 +20,15 @@
use clone::Clone;
use io::IoResult;
use iter::Iterator;
use slice::ImmutableSlice;
use result::{Ok,Err};
use io::net::addrinfo::get_host_addresses;
use io::net::ip::{SocketAddr, ToSocketAddr};
use io::{IoError, ConnectionFailed, InvalidInput};
use io::IoError;
use io::{Reader, Writer, Listener, Acceptor};
use io::{standard_error, TimedOut};
use from_str::FromStr;
use kinds::Send;
use option::{None, Some, Option};
use boxed::Box;
use rt::rtio::{IoFactory, LocalIo, RtioSocket, RtioTcpListener};
use rt::rtio::{IoFactory, RtioSocket, RtioTcpListener};
use rt::rtio::{RtioTcpAcceptor, RtioTcpStream};
use rt::rtio;
use time::Duration;

View File

@ -22,7 +22,7 @@ use kinds::Send;
use boxed::Box;
use option::Option;
use result::{Ok, Err};
use rt::rtio::{RtioSocket, RtioUdpSocket, IoFactory, LocalIo};
use rt::rtio::{RtioSocket, RtioUdpSocket, IoFactory};
use rt::rtio;
/// A User Datagram Protocol socket.

View File

@ -24,7 +24,7 @@ fn main() {
}
fn test() {
let mut l = TcpListener::bind("127.0.0.1", 0).unwrap();
let mut l = TcpListener::bind("127.0.0.1:0").unwrap();
let addr = l.socket_name().unwrap();
let mut a = l.listen().unwrap();
let cnt = Arc::new(atomic::AtomicUint::new(0));
@ -56,8 +56,7 @@ fn test() {
let cli_tx = cli_tx.clone();
spawn(proc() {
for _ in range(0, M) {
let _s = TcpStream::connect(addr.ip.to_string().as_slice(),
addr.port).unwrap();
let _s = TcpStream::connect(addr).unwrap();
}
cli_tx.send(());
});

View File

@ -31,13 +31,11 @@ use std::time::Duration;
#[cfg_attr(target_os = "freebsd", ignore)]
fn eventual_timeout() {
let addr = next_test_ip4();
let host = addr.ip.to_string();
let port = addr.port;
let (tx1, rx1) = channel();
let (_tx2, rx2) = channel::<()>();
std::task::spawn(proc() {
let _l = TcpListener::bind(host.as_slice(), port).unwrap().listen();
let _l = TcpListener::bind(addr).unwrap().listen();
tx1.send(());
let _ = rx2.recv_opt();
});
@ -56,9 +54,7 @@ fn eventual_timeout() {
fn timeout_success() {
let addr = next_test_ip4();
let host = addr.ip.to_string();
let port = addr.port;
let _l = TcpListener::bind(host.as_slice(), port).unwrap().listen();
let _l = TcpListener::bind(addr).unwrap().listen();
assert!(TcpStream::connect_timeout(addr, Duration::milliseconds(1000)).is_ok());
}

View File

@ -33,7 +33,7 @@ fn main() {
let (tx, rx) = channel();
spawn(proc() {
let mut listener = TcpListener::bind("127.0.0.1", 0).unwrap();
let mut listener = TcpListener::bind("127.0.0.1:0").unwrap();
tx.send(listener.socket_name().unwrap());
let mut acceptor = listener.listen();
loop {
@ -54,9 +54,7 @@ fn main() {
for _ in range(0u, 1000) {
let tx = tx.clone();
TaskBuilder::new().stack_size(64 * 1024).spawn(proc() {
let host = addr.ip.to_string();
let port = addr.port;
match TcpStream::connect(host.as_slice(), port) {
match TcpStream::connect(addr) {
Ok(stream) => {
let mut stream = stream;
stream.write([1]);