]> git.saurik.com Git - apple/objc4.git/blobdiff - test/nsobject.m
objc4-437.tar.gz
[apple/objc4.git] / test / nsobject.m
diff --git a/test/nsobject.m b/test/nsobject.m
new file mode 100644 (file)
index 0000000..7e831c2
--- /dev/null
@@ -0,0 +1,24 @@
+#include "test.h"
+
+#import <Foundation/Foundation.h>
+
+@interface Sub : NSObject { } @end
+@implementation Sub 
++allocWithZone:(NSZone *)zone { 
+    testprintf("in +[Sub alloc]\n");
+    return [super allocWithZone:zone];
+    }
+-(void)dealloc { 
+    testprintf("in -[Sub dealloc]\n");
+    [super dealloc];
+}
+@end
+
+int main()
+{
+    NSAutoreleasePool *pool = [NSAutoreleasePool new];
+    [[Sub new] autorelease];
+    [pool release];
+
+    succeed(__FILE__);
+}