Skip to content

Commit

Permalink
Rollup merge of #77918 - wcampbell0x2a:cleanup-network-tests, r=m-ou-se
Browse files Browse the repository at this point in the history
Cleanup network tests

Some cleanup for network related tests
  • Loading branch information
JohnTitor committed Oct 23, 2020
2 parents 4859786 + 964a5ac commit b968738
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
3 changes: 1 addition & 2 deletions library/std/src/fs/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@ pub fn got_symlink_permission(tmpdir: &TempDir) -> bool {
let link = tmpdir.join("some_hopefully_unique_link_name");

match symlink_file(r"nonexisting_target", link) {
Ok(_) => true,
// ERROR_PRIVILEGE_NOT_HELD = 1314
Err(ref err) if err.raw_os_error() == Some(1314) => false,
Err(_) => true,
Ok(_) | Err(_) => true,
}
}

Expand Down
14 changes: 4 additions & 10 deletions library/std/src/net/udp/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,13 @@ fn udp_clone_two_write() {
let (done, rx) = channel();
let tx2 = tx.clone();
let _t = thread::spawn(move || {
match sock3.send_to(&[1], &addr2) {
Ok(..) => {
let _ = tx2.send(());
}
Err(..) => {}
if sock3.send_to(&[1], &addr2).is_ok() {
let _ = tx2.send(());
}
done.send(()).unwrap();
});
match sock1.send_to(&[2], &addr2) {
Ok(..) => {
let _ = tx.send(());
}
Err(..) => {}
if sock1.send_to(&[2], &addr2).is_ok() {
let _ = tx.send(());
}
drop(tx);

Expand Down

0 comments on commit b968738

Please sign in to comment.