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