mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
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:
parent
9f593f6b8e
commit
53f5c4ec97
1 changed files with 24 additions and 0 deletions
24
Tests/base/NSException/throwstr.m
Normal file
24
Tests/base/NSException/throwstr.m
Normal 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;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue