]> git.saurik.com Git - apple/objc4.git/blob - test/nsobject.m
objc4-532.2.tar.gz
[apple/objc4.git] / test / nsobject.m
1 // TEST_CONFIG MEM=mrc,gc
2
3 #include "test.h"
4
5 #import <Foundation/NSObject.h>
6
7 @interface Sub : NSObject { } @end
8 @implementation Sub
9 +(id)allocWithZone:(NSZone *)zone {
10 testprintf("in +[Sub alloc]\n");
11 return [super allocWithZone:zone];
12 }
13 -(void)dealloc {
14 testprintf("in -[Sub dealloc]\n");
15 [super dealloc];
16 }
17 @end
18
19 int main()
20 {
21 PUSH_POOL {
22 [[Sub new] autorelease];
23 } POP_POOL;
24
25 succeed(__FILE__);
26 }