libs-base/Tests/base/NSException/throwstr.m
Richard Frith-MacDonald 257db34f47 tweak
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32569 72102866-910b-0410-8b05-ffd578937521
2011-03-14 09:56:46 +00:00

24 lines
523 B
Objective-C

#import "Testing.h"
#import <Foundation/Foundation.h>
int main(void)
{
START_SET("String throwing")
#if defined(BASE_NATIVE_OBJC_EXCEPTIONS) && BASE_NATIVE_OBJC_EXCEPTIONS == 1
id caught = nil;
id thrown = @"thrown";
@try
{
@throw thrown;
}
@catch (id str)
{
caught = str;
}
PASS((caught == thrown), "Throwing an NSConstantString instance before the class is initialised");
#else
SKIP("Native exceptions not supported")
#endif
END_SET("String throwing")
return 0;
}