MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / test_unix_msg_unconnected

Function test_unix_msg_unconnected

tests/net/unix.rs:397–417  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

395#[cfg(not(any(target_os = "espidf", target_os = "redox", target_os = "wasi")))]
396#[test]
397fn test_unix_msg_unconnected() {
398 use rustix::ffi::CString;
399 use std::os::unix::ffi::OsStrExt as _;
400
401 crate::init();
402
403 let tmpdir = tempfile::tempdir().unwrap();
404 let path = tmpdir.path().join("scp_4804");
405
406 let name = SocketAddrUnix::new(&path).unwrap();
407 assert_eq!(
408 name.path(),
409 Some(CString::new(path.as_os_str().as_bytes()).unwrap().into())
410 );
411 assert_eq!(name.path_bytes(), Some(path.as_os_str().as_bytes()));
412 #[cfg(linux_kernel)]
413 assert!(!name.is_unnamed());
414 do_test_unix_msg_unconnected(name);
415
416 unlinkat(CWD, path, AtFlags::empty()).unwrap();
417}
418
419#[cfg(linux_kernel)]
420#[test]

Callers

nothing calls this directly

Calls 4

initFunction · 0.70
unlinkatFunction · 0.50
pathMethod · 0.45

Tested by

no test coverage detected