2011-02-16 08:21:17 +00:00
|
|
|
#import "ObjectTesting.h"
|
|
|
|
#import <Foundation/NSAutoreleasePool.h>
|
|
|
|
#import <Foundation/NSInvocation.h>
|
|
|
|
#import <Foundation/NSRunLoop.h>
|
|
|
|
#import <Foundation/NSTimer.h>
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
|
|
|
NSMethodSignature *sig;
|
|
|
|
NSInvocation *inv;
|
|
|
|
NSTimer *tim;
|
|
|
|
NSRunLoop *run;
|
|
|
|
NSDate *date;
|
|
|
|
|
|
|
|
sig = [NSTimer instanceMethodSignatureForSelector:@selector(isValid)];
|
|
|
|
inv = [NSInvocation invocationWithMethodSignature: sig];
|
|
|
|
|
|
|
|
run = [NSRunLoop currentRunLoop];
|
|
|
|
PASS(run != nil, "NSRunLoop understands [+currentRunLoop]");
|
|
|
|
PASS([run currentMode] == nil, "-currentMode returns nil");
|
|
|
|
|
2011-02-24 16:26:01 +00:00
|
|
|
PASS_RUNS(date = [NSDate dateWithTimeIntervalSinceNow:3];
|
2011-02-16 08:21:17 +00:00
|
|
|
[run runUntilDate:date];,
|
2011-02-24 16:26:01 +00:00
|
|
|
"-runUntilDate: works");
|
|
|
|
PASS_RUNS(date = [NSDate dateWithTimeIntervalSinceNow:5];
|
2011-02-16 08:21:17 +00:00
|
|
|
tim = [NSTimer scheduledTimerWithTimeInterval: 2.0
|
|
|
|
invocation:inv
|
|
|
|
repeats:YES];,
|
2011-02-24 16:26:01 +00:00
|
|
|
"-runUntilDate: works with a timer");
|
2011-02-16 08:21:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[arp release]; arp = nil;
|
|
|
|
return 0;
|
|
|
|
}
|