1
Fork 0

Fix test cases for MacOs

This commit is contained in:
LinkTed 2020-10-21 17:51:53 +02:00
parent 79273fa30c
commit ea5e012ba7

View file

@ -1,7 +1,25 @@
use super::*; use super::*;
use crate::io::prelude::*; use crate::io::prelude::*;
use crate::io::{self, ErrorKind, IoSlice, IoSliceMut}; use crate::io::{self, ErrorKind, IoSlice, IoSliceMut};
#[cfg(any(
target_os = "android",
target_os = "dragonfly",
target_os = "emscripten",
target_os = "freebsd",
target_os = "linux",
target_os = "netbsd",
target_os = "openbsd",
))]
use crate::iter::FromIterator; use crate::iter::FromIterator;
#[cfg(any(
target_os = "android",
target_os = "dragonfly",
target_os = "emscripten",
target_os = "freebsd",
target_os = "linux",
target_os = "netbsd",
target_os = "openbsd",
))]
use crate::os::unix::io::AsRawFd; use crate::os::unix::io::AsRawFd;
use crate::sys_common::io::test::tmpdir; use crate::sys_common::io::test::tmpdir;
use crate::thread; use crate::thread;
@ -454,6 +472,15 @@ fn test_unix_datagram_peek_from() {
assert_eq!(msg, &buf[..]); assert_eq!(msg, &buf[..]);
} }
#[cfg(any(
target_os = "android",
target_os = "dragonfly",
target_os = "emscripten",
target_os = "freebsd",
target_os = "linux",
target_os = "netbsd",
target_os = "openbsd",
))]
#[test] #[test]
fn test_send_vectored_fds_unix_stream() { fn test_send_vectored_fds_unix_stream() {
let (s1, s2) = or_panic!(UnixStream::pair()); let (s1, s2) = or_panic!(UnixStream::pair());
@ -491,7 +518,7 @@ fn test_send_vectored_fds_unix_stream() {
} }
} }
#[cfg(any(test, target_os = "android", target_os = "emscripten", target_os = "linux",))] #[cfg(any(target_os = "android", target_os = "emscripten", target_os = "linux",))]
#[test] #[test]
fn test_send_vectored_with_ancillary_to_unix_datagram() { fn test_send_vectored_with_ancillary_to_unix_datagram() {
fn getpid() -> libc::pid_t { fn getpid() -> libc::pid_t {
@ -559,7 +586,6 @@ fn test_send_vectored_with_ancillary_to_unix_datagram() {
} }
#[cfg(any( #[cfg(any(
test,
target_os = "android", target_os = "android",
target_os = "dragonfly", target_os = "dragonfly",
target_os = "emscripten", target_os = "emscripten",