Skip to content

Commit ea5e012

Browse files
committed
Fix test cases for MacOs
1 parent 79273fa commit ea5e012

File tree

1 file changed

+28
-2
lines changed
  • library/std/src/sys/unix/ext/net

1 file changed

+28
-2
lines changed

library/std/src/sys/unix/ext/net/tests.rs

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
11
use super::*;
22
use crate::io::prelude::*;
33
use crate::io::{self, ErrorKind, IoSlice, IoSliceMut};
4+
#[cfg(any(
5+
target_os = "android",
6+
target_os = "dragonfly",
7+
target_os = "emscripten",
8+
target_os = "freebsd",
9+
target_os = "linux",
10+
target_os = "netbsd",
11+
target_os = "openbsd",
12+
))]
413
use crate::iter::FromIterator;
14+
#[cfg(any(
15+
target_os = "android",
16+
target_os = "dragonfly",
17+
target_os = "emscripten",
18+
target_os = "freebsd",
19+
target_os = "linux",
20+
target_os = "netbsd",
21+
target_os = "openbsd",
22+
))]
523
use crate::os::unix::io::AsRawFd;
624
use crate::sys_common::io::test::tmpdir;
725
use crate::thread;
@@ -454,6 +472,15 @@ fn test_unix_datagram_peek_from() {
454472
assert_eq!(msg, &buf[..]);
455473
}
456474

475+
#[cfg(any(
476+
target_os = "android",
477+
target_os = "dragonfly",
478+
target_os = "emscripten",
479+
target_os = "freebsd",
480+
target_os = "linux",
481+
target_os = "netbsd",
482+
target_os = "openbsd",
483+
))]
457484
#[test]
458485
fn test_send_vectored_fds_unix_stream() {
459486
let (s1, s2) = or_panic!(UnixStream::pair());
@@ -491,7 +518,7 @@ fn test_send_vectored_fds_unix_stream() {
491518
}
492519
}
493520

494-
#[cfg(any(test, target_os = "android", target_os = "emscripten", target_os = "linux",))]
521+
#[cfg(any(target_os = "android", target_os = "emscripten", target_os = "linux",))]
495522
#[test]
496523
fn test_send_vectored_with_ancillary_to_unix_datagram() {
497524
fn getpid() -> libc::pid_t {
@@ -559,7 +586,6 @@ fn test_send_vectored_with_ancillary_to_unix_datagram() {
559586
}
560587

561588
#[cfg(any(
562-
test,
563589
target_os = "android",
564590
target_os = "dragonfly",
565591
target_os = "emscripten",

0 commit comments

Comments
 (0)