objective-c/tests.lisp
in-package#:luv.tests
objc:define-objective-c-messagemake-exception-test-array
"new":object:ownership:owned:class"NSMutableArray"
objc:define-objective-c-messageexception-test-array-object-at-index
"objectAtIndex:":object:ownership:borrowed
index:uint64
deftestobjective-c-dispatch-entry-is-resolved-once
ok
cffi:pointerpobjc::*objective-c-message-send-pointer*
ok
not
cffi:null-pointer-pobjc::*objective-c-message-send-pointer*
ok
not
fboundp'objc::objective-c-message-send-pointer
deftestmessage-definitions-retain-selector-abi-and-ownership
let
ok
equal
getfdescription:selector
"name"ok
eq
getfdescription:result-type
:objectok
eq
getfdescription:result-ownership
:borrowedok
equal
getfdescription:result-class
"NSString"ok
equal
getfdescription:argument-types
'objc::receiver:object
deftestclasses-and-objects-preserve-native-identity-and-ownership
objc:with-autorelease-pool
objc:with-owned-objective-c-object
ok
ok
eq
objc:objective-c-object-ownershipdevice
:ownedok
equal
objc:objective-c-object-protocol-namedevice
"MTLDevice"let*
borrowed-name
metal:device-namedevice
owned-name
objc:retain-objective-c-objectborrowed-name
ok
eq
objc:objective-c-object-ownershipborrowed-name
:borrowedok
ok
objc:release-objective-c-objectowned-name
ok
objc:objective-c-object-released-powned-name
ok
deftestdeclared-messages-have-opt-in-backend-local-tracing
let
trace
objc:with-autorelease-pool
objc:with-owned-objective-c-object
objc:with-objective-c-trace
active-trace
setftraceactive-trace
ok
plusp
metal:device-registry-iddevice
ok
stringp
let*
events
descriptions
registry
find"registryID"descriptions:test#'equal:key
lambda
description
getfdescription:selector
okregistry
ok
eq
getfregistry:status
:returnedok
eq
getfregistry:result-type
:uint64ok
deftestexception-policy-is-dynamic-and-tracing-is-orthogonal
ok
eqobjc:*objective-c-exception-policy*:unchecked
let
trace
objc:with-autorelease-pool
objc:with-owned-objective-c-object
objc:with-objective-c-trace
active-trace
setftraceactive-trace
objc:with-unchecked-objective-c-messages
ok
ok
plusp
metal:device-registry-iddevice
ok
ok
let
events
dolist
eventevents
ok
eq
objc:objective-c-message-event-statusevent
:returneddeftestfresh-device-probe-is-bounded-and-printable
let
description
ok
stringp
getfdescription:class
ok
equal
getfdescription:protocol
"MTLDevice"ok
plusp
length
getfdescription:name
ok
plusp
getfdescription:registry-id
deftestnative-exceptions-become-conditions-and-leave-the-image-live
objc:with-autorelease-pool
objc:with-owned-objective-c-object
array
make-exception-test-array
objc:find-objective-c-class"NSMutableArray"
let
conditiontrace
objc:with-objective-c-trace
active-trace
setftraceactive-trace
handler-case
objc:objective-c-exception
signaled
setfconditionsignaled
ok
zerop
ok
ok
equal
objc:objective-c-exception-namecondition
"NSRangeException"ok
equal
objc:objective-c-exception-selectorcondition
"objectAtIndex:"ok
eq
objc:objective-c-exception-receivercondition
arrayok
ok
plusp
length
objc:objective-c-exception-reasoncondition
ok
plusp
length
objc:objective-c-exception-call-stackcondition
let
events
ok
eq
objc:objective-c-message-event-status
:signaledfirstevents
ok
ok
deftestdeclaration-abi-mismatches-stop-before-the-message-send
objc:with-autorelease-pool
objc:with-owned-objective-c-object
array
make-exception-test-array
objc:find-objective-c-class"NSMutableArray"
handler-case
objc:with-objective-c-exception-handling
fail"The malformed declaration returned."
objc:objective-c-bridge-error
condition
ok
search"8-byte result"
objc:objective-c-exception-reasoncondition
ok
ok
zerop
defmacro define-objective-c-message
(name (selector result-type &key ownership class consumes-receiver)
&body arguments)defvar *objective-c-message-send-pointer*
The stable libobjc dispatch entry, resolved once when this runtime loads. Resolving this symbol for every declared message used to put dlsym on the per-frame path hundreds of times. #WEE1DX
define-arithmetic-operator not
Logical negation of one test or raw truth value.
defmacro with-autorelease-pool
(() &body body)defmacro with-owned-objective-c-object
((variable form) &body body)defclass objective-c-object
One native Objective-C pointer and exactly one owned or borrowed claim.
defun retain-objective-c-object
(object)defun objective-c-object=
(left right)defun release-objective-c-object
(object)defmacro with-objective-c-trace
((trace) &body body)defun objective-c-string
(object)define-arithmetic-operator =
Test whether two compatible scalars are equal.
defvar *objective-c-exception-policy*
How declared messages cross the native boundary: :CATCH or :UNCHECKED. :UNCHECKED calls objc_msgSend directly and is the ordinary path. :CATCH uses the native NSInvocation exception bridge for an explicit diagnostic scope.
defmacro with-unchecked-objective-c-messages
(() &body body)defmacro with-objective-c-exception-handling
(() &body body)define-condition objective-c-bridge-error
The native boundary could not perform a declared Objective-C message.