diff options
| author | Eval EXEC <execvy@gmail.com> | 2023-06-20 18:47:31 +0800 |
|---|---|---|
| committer | Eval EXEC <execvy@gmail.com> | 2023-06-20 18:47:31 +0800 |
| commit | a0c757a13f5a0090f8cb6e1a7ffba6b94dfc2fbf (patch) | |
| tree | 0c4815a39014154aa40ac31d9d49c996f98355dc | |
| parent | 30e1c1a53c8354d53551f4640a41938a157b4fd0 (diff) | |
| download | rust-a0c757a13f5a0090f8cb6e1a7ffba6b94dfc2fbf.tar.gz rust-a0c757a13f5a0090f8cb6e1a7ffba6b94dfc2fbf.zip | |
Remove useless unit tests
| -rw-r--r-- | library/std/src/net/tcp/tests.rs | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/library/std/src/net/tcp/tests.rs b/library/std/src/net/tcp/tests.rs index 12979db25d3..db367cfa0f7 100644 --- a/library/std/src/net/tcp/tests.rs +++ b/library/std/src/net/tcp/tests.rs @@ -47,17 +47,6 @@ fn connect_error() { } #[test] -fn connect_timeout_to_unreachable_address() { - let now = Instant::now(); - match TcpStream::connect_timeout(&format!("1.1.1.1:9999").parse().unwrap(), Duration::MAX) { - Ok(..) => panic!("connected to an unreachable address, this is impossible"), - Err(e) => assert_eq!(e.kind(), ErrorKind::TimedOut), - } - - assert!(now.elapsed() > Duration::from_secs(20)); -} - -#[test] #[cfg_attr(target_env = "sgx", ignore)] // FIXME: https://github.com/fortanix/rust-sgx/issues/31 fn connect_timeout_error() { let socket_addr = next_test_ip4(); @@ -69,16 +58,6 @@ fn connect_timeout_error() { } #[test] -fn connect_timeout_ok_bind() { - let listener = TcpListener::bind("127.0.0.1:0").unwrap(); // :0 picks some free port - let port = listener.local_addr().unwrap().port(); // obtain the port it picked - assert!( - TcpStream::connect_timeout(&format!("127.0.0.1:{port}").parse().unwrap(), Duration::MAX) - .is_ok() - ); -} - -#[test] fn listen_localhost() { let socket_addr = next_test_ip4(); let listener = t!(TcpListener::bind(&socket_addr)); |
