Closed abbeycode closed 8 years ago
I've had a look at this. In Debug (-Onone), it is possible to walk through the stack frames to the message
parameter passed to the underlying _assertionFailure
function. It involves making some dirty assumptions about how many stack frames and the location within the stack frame but you can do it.
In Release build, it is not possible. The entire precondition
(or other test function) is inlined into the caller and the message
parameter is gone from the stack before the ud2
occurs.
Is there a way to retrieve the message from the assertion failure, in order to validate it? I can't see it on the returned
NSException
. It would be great if it were available in the exception'suserInfo
orreason
property.