libs-base/Tests/base/NSCalendar/create.m
rfm 3fba03ba55 Important change to the START_SET and END_SET macros to stop their use
being confusing.  They now both take a simple C-string argument which
names the set, and the macros check that each end matches a start of
the same name.  Since tis means that a START_SET no longer takes an
argument sayng whether or notthe set is to be skipped, we now have a
SKIP macro to be used inside a set to skip to the end of it.  This
is actually more versatile as we can have multiple SKIP macros in the
same set, each providing a different reason for the set being skipped.
Also removed a few obsolete/unused functions and macros.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32355 72102866-910b-0410-8b05-ffd578937521
2011-02-24 16:26:01 +00:00

32 lines
952 B
Objective-C

#import <Foundation/NSAutoreleasePool.h>
#import <Foundation/NSLocale.h>
#import <Foundation/NSCalendar.h>
#import "ObjectTesting.h"
#if defined(GS_USE_ICU)
#define NSCALENDAR_SUPPORTED GS_USE_ICU
#else
#define NSCALENDAR_SUPPORTED 1 /* Assume Apple support */
#endif
int main(void)
{
START_SET("NSCalendar create")
NSCalendar *cal;
if (!NSCALENDAR_SUPPORTED)
SKIP("NSCalendar not supported\nThe ICU library was not available when GNUstep-base was built")
cal = [NSCalendar currentCalendar];
PASS (cal != nil, "+currentCalendar returns non-nil");
TEST_FOR_CLASS(@"NSCalendar", cal, "+currentCalendar return a NSCalendar");
cal = [[NSCalendar alloc] initWithCalendarIdentifier: NSGregorianCalendar];
PASS (cal != nil, "-initWithCalendarIdentifier: return non-nil");
TEST_FOR_CLASS(@"NSCalendar", cal,
"-initWithCalendarIdentifier: return a NSCalendar");
RELEASE(cal);
END_SET("NSCalendar create")
return 0;
}