Skip to content

Commit d3e7700

Browse files
committed
std: net: enable bind_error test on all platforms
Bind on non-local IP address is essentially the same test, and it works same way on all platforms. Fixes rust-lang#11530
1 parent 68740b4 commit d3e7700

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libstd/net/tcp.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,13 @@ mod tests {
233233
}
234234
}
235235

236-
// FIXME #11530 this fails on android because tests are run as root
237-
#[cfg_attr(any(windows, target_os = "android"), ignore)]
238236
#[test]
239237
fn bind_error() {
240-
match TcpListener::bind("0.0.0.0:1") {
238+
match TcpListener::bind("1.1.1.1:9999") {
241239
Ok(..) => panic!(),
242-
Err(e) => assert_eq!(e.kind(), ErrorKind::PermissionDenied),
240+
Err(e) =>
241+
// EADDRNOTAVAIL is mapped to ConnectionRefused
242+
assert_eq!(e.kind(), ErrorKind::ConnectionRefused),
243243
}
244244
}
245245

0 commit comments

Comments
 (0)