libs-base/Tests/base/NSTimeZone/create.m
rfm b179b29898 import testsuite
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32187 72102866-910b-0410-8b05-ffd578937521
2011-02-16 08:21:17 +00:00

41 lines
1.3 KiB
Objective-C

#import "ObjectTesting.h"
#import <Foundation/NSAutoreleasePool.h>
#import <Foundation/NSTimeZone.h>
int main()
{
NSAutoreleasePool *arp = [NSAutoreleasePool new];
id current;
id localh;
current = [NSTimeZone defaultTimeZone];
PASS(current != nil && [current isKindOfClass: [NSTimeZone class]],
"+defaultTimeZone works");
current = [NSTimeZone localTimeZone];
PASS(current != nil && [current isKindOfClass: [NSTimeZone class]],
"+localTimeZone works");
current = [NSTimeZone systemTimeZone];
PASS(current != nil && [current isKindOfClass: [NSTimeZone class]],
"+systemTimeZone works");
current = [NSTimeZone timeZoneForSecondsFromGMT: 900];
PASS(current != nil && [current isKindOfClass: [NSTimeZone class]],
"+timeZoneForSecondsFromGMT works");
current = [NSTimeZone timeZoneForSecondsFromGMT: 90000];
PASS(current == nil,
"+timeZoneForSecondsFromGMT fails for bad offset");
current = [NSTimeZone timeZoneWithAbbreviation: @"MST"];
PASS(current != nil && [current isKindOfClass: [NSTimeZone class]],
"+timeZoneWithAbbreviation works");
current = [NSTimeZone timeZoneWithName: @"GB"];
PASS(current != nil && [current isKindOfClass: [NSTimeZone class]],
"+timeZoneWithName works");
[arp release]; arp = nil;
return 0;
}