Added test that the runtime allows us to throw instances of objects that have not been properly initialised.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32337 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
David Chisnall 2011-02-23 18:39:26 +00:00
parent 9f593f6b8e
commit 53f5c4ec97

View file

@ -0,0 +1,24 @@
#import "Testing.h"
#import <Foundation/Foundation.h>
int main(void)
{
#if BASE_NATIVE_OBJC_EXCEPTIONS == 1
id caught = nil;
id thrown = @"thrown";
@try
{
@throw thrown;
}
@catch (id str)
{
caught = str;
}
[NSAutoreleasePool new];
PASS((caught == thrown), "Throwing an NSConstantString instance before the class is initialised");
#else
[NSAutoreleasePool new];
unsupported("Native exceptions");
#endif
return 0;
}