mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-05 06:01:17 +00:00
with something that doesn't do a very good job of optimising autorelease operations away. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33644 72102866-910b-0410-8b05-ffd578937521
17 lines
439 B
Objective-C
17 lines
439 B
Objective-C
#import "ObjectTesting.h"
|
|
#import <Foundation/NSPointerArray.h>
|
|
|
|
int main(void)
|
|
{
|
|
[NSAutoreleasePool new];
|
|
id pool = [NSAutoreleasePool new];
|
|
NSPointerArray *pa = [[NSPointerArray pointerArrayWithWeakObjects] retain];
|
|
id obj = [NSObject new];
|
|
[pa addPointer: obj];
|
|
PASS([pa count] == 1, "Added object to weak array");
|
|
[obj release];
|
|
[pool drain];
|
|
[pa compact];
|
|
PASS([pa count] == 0, "Removed object to weak array");
|
|
return 0;
|
|
}
|