1
/* Test/example program for the base library
3
Copyright (C) 2005 Free Software Foundation, Inc.
5
Copying and distribution of this file, with or without modification,
6
are permitted in any medium without royalty provided the copyright
7
notice and this notice are preserved.
9
This file is part of the GNUstep Base Library.
11
#include <Foundation/NSRunLoop.h>
12
#include <Foundation/NSTimer.h>
13
#include <Foundation/NSInvocation.h>
14
#include <Foundation/NSAutoreleasePool.h>
16
@interface TestDouble : NSObject
17
+ (double) testDouble;
18
- (double) testDoubleInstance;
20
@implementation TestDouble
24
printf ("Timer fired %d times\n", ++count);
30
return 12345678912345.0;
32
- (double) testDoubleInstance
34
return 92345678912345.0;
40
return 92345678912345.0;
46
NSAutoreleasePool *arp = [NSAutoreleasePool new];
47
volatile double foo, bar;
52
inv = [NSInvocation invocationWithMethodSignature:
53
[TestDouble methodSignatureForSelector: @selector(sayCount)]];
54
[inv setSelector: @selector(sayCount)];
55
[inv setTarget: [TestDouble class]];
57
foo = [TestDouble testDouble];
58
printf ("TestDouble is %f\n", foo);
59
foo = [TestDouble testDouble];
60
printf ("TestDouble 2 is %f\n", foo);
61
o = [[TestDouble alloc] init];
62
bar = [o testDoubleInstance];
63
printf ("testDouble is %f\n", bar);
66
printf ("test_double is %f\n", foo);
69
printf ("time interval since now %f\n", [d timeIntervalSinceNow]);
71
[NSTimer scheduledTimerWithTimeInterval: 3.0
74
[[NSRunLoop currentRunLoop] run];