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

Function test_unix_msg_unconnected

tests/net/unix_alloc.rs:394–414  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

initFunction · 0.70
unlinkatFunction · 0.50
pathMethod · 0.45

Tested by

no test coverage detected