MCPcopy Create free account
hub / github.com/elast0ny/shared_memory / create_with_flink

Function create_with_flink

tests/general.rs:20–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18
19#[test]
20fn create_with_flink() {
21 let flink = Path::new("create_new1");
22
23 let mut s = ShmemConf::new().flink(flink).size(4090).create().unwrap();
24
25 assert!(s.is_owner());
26 assert!(!s.get_os_id().is_empty());
27 assert!(flink.is_file());
28 assert!(s.len() >= 4090);
29 assert!(!s.as_ptr().is_null());
30 unsafe {
31 assert_eq!(s.as_slice().len(), s.len());
32 assert_eq!(s.as_slice_mut().len(), s.len());
33 }
34
35 drop(s);
36
37 assert!(!flink.is_file());
38}
39
40#[test]
41fn open_os_id() {

Callers

nothing calls this directly

Calls 3

createMethod · 0.80
sizeMethod · 0.80
flinkMethod · 0.80

Tested by

no test coverage detected