Add test for unexpected exception hook
parent
71e38a048f
commit
ca46e42516
@ -0,0 +1,20 @@
|
|||||||
|
#include "Test.h"
|
||||||
|
#include "../objc/hooks.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
id exceptionObj = @"Exception";
|
||||||
|
|
||||||
|
void UncaughtExceptionHandler(id exception)
|
||||||
|
{
|
||||||
|
assert(exception == exceptionObj);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
_objc_unexpected_exception = UncaughtExceptionHandler;
|
||||||
|
@throw exceptionObj;
|
||||||
|
assert(0 && "should not be reached!");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue