MCPcopy Create free account
hub / github.com/SSheldon/rust-objc / test_weak_copy

Function test_weak_copy

src/rc/mod.rs:93–102  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

91
92 #[test]
93 fn test_weak_copy() {
94 let obj = unsafe {
95 StrongPtr::new(msg_send![class!(NSObject), new])
96 };
97 let weak = obj.weak();
98
99 let weak2 = weak.clone();
100 let strong = weak2.load();
101 assert!(*strong == *obj);
102 }
103
104 #[test]
105 fn test_autorelease() {

Callers

nothing calls this directly

Calls 3

weakMethod · 0.80
loadMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected