2011-02-16 08:21:17 +00:00
|
|
|
#import <Foundation/NSAutoreleasePool.h>
|
|
|
|
#import <Foundation/NSLocale.h>
|
|
|
|
#import "ObjectTesting.h"
|
|
|
|
|
|
|
|
#if defined(GS_USE_ICU)
|
|
|
|
#define NSLOCALE_SUPPORTED GS_USE_ICU
|
|
|
|
#else
|
|
|
|
#define NSLOCALE_SUPPORTED 1 /* Assume Apple support */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
2011-02-24 16:26:01 +00:00
|
|
|
START_SET("NSLocale")
|
2011-02-16 08:21:17 +00:00
|
|
|
NSLocale *locale;
|
|
|
|
|
2011-02-24 16:26:01 +00:00
|
|
|
if (!NSLOCALE_SUPPORTED)
|
|
|
|
SKIP("NSLocale not supported\nThe ICU library was not available when GNUstep-base was built")
|
2011-02-16 08:21:17 +00:00
|
|
|
locale = [NSLocale systemLocale];
|
|
|
|
PASS (locale != nil, "+systemLocale returns non-nil");
|
|
|
|
TEST_FOR_CLASS(@"NSLocale", locale, "+systemLocale return a NSLocale");
|
|
|
|
|
|
|
|
locale = [NSLocale currentLocale];
|
|
|
|
PASS (locale != nil, "+currentLocale return non-nil");
|
|
|
|
TEST_FOR_CLASS(@"NSLocale", locale, "+currentLocale return a NSLocale");
|
|
|
|
|
2011-02-24 16:26:01 +00:00
|
|
|
END_SET("NSLocale")
|
2011-02-16 08:21:17 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|