File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -368,6 +368,28 @@ mod tests {
368368 use super :: * ;
369369 use crate :: rc:: { Allocated , Id , Owned , Shared } ;
370370 use crate :: runtime:: Object ;
371+ use crate :: { Encoding , RefEncode } ;
372+
373+ #[ repr( C ) ]
374+ struct _NSZone {
375+ _inner : [ u8 ; 0 ] ,
376+ }
377+
378+ unsafe impl RefEncode for _NSZone {
379+ const ENCODING_REF : Encoding < ' static > =
380+ Encoding :: Pointer ( & Encoding :: Struct ( "_NSZone" , & [ ] ) ) ;
381+ }
382+
383+ #[ test]
384+ fn test_macro_alloc ( ) {
385+ let cls = class ! ( NSObject ) ;
386+
387+ let _obj: Option < Id < Allocated < Object > , Shared > > = unsafe { msg_send_id ! [ cls, alloc] } ;
388+
389+ let zone: * const _NSZone = ptr:: null ( ) ;
390+ let _obj: Option < Id < Allocated < Object > , Owned > > =
391+ unsafe { msg_send_id ! [ cls, allocWithZone: zone] } ;
392+ }
371393
372394 #[ test]
373395 fn test_macro ( ) {
You can’t perform that action at this time.
0 commit comments