()
| 367 | #[cfg(not(target_os = "freebsd"))] // TODO: Investigate why these tests fail on FreeBSD. |
| 368 | #[test] |
| 369 | fn test_unix_msg() { |
| 370 | use rustix::ffi::CString; |
| 371 | use std::os::unix::ffi::OsStrExt as _; |
| 372 | |
| 373 | crate::init(); |
| 374 | |
| 375 | let tmpdir = tempfile::tempdir().unwrap(); |
| 376 | let path = tmpdir.path().join("scp_4804"); |
| 377 | |
| 378 | let name = SocketAddrUnix::new(&path).unwrap(); |
| 379 | assert_eq!( |
| 380 | name.path(), |
| 381 | Some(CString::new(path.as_os_str().as_bytes()).unwrap().into()) |
| 382 | ); |
| 383 | assert_eq!(name.path_bytes(), Some(path.as_os_str().as_bytes())); |
| 384 | #[cfg(linux_kernel)] |
| 385 | assert!(!name.is_unnamed()); |
| 386 | do_test_unix_msg(name); |
| 387 | |
| 388 | unlinkat(CWD, path, AtFlags::empty()).unwrap(); |
| 389 | } |
| 390 | |
| 391 | /// Like `test_unix_msg` but tests `do_test_unix_msg_unconnected`. |
| 392 | #[cfg(not(any(target_os = "espidf", target_os = "redox", target_os = "wasi")))] |
nothing calls this directly
no test coverage detected