More leaks fixed

This commit is contained in:
rfm 2024-11-16 13:34:56 +00:00
parent 87c50830e2
commit aedd13dc94
19 changed files with 174 additions and 153 deletions

View file

@ -22,10 +22,9 @@
int main()
{
NSNotification *obj;
NSMutableArray *testObjs = [[NSMutableArray alloc] init];
NSAutoreleasePool *arp = [NSAutoreleasePool new];
ENTER_POOL
NSNotification *obj;
NSMutableArray *testObjs = [NSMutableArray array];
NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:
@"obj", @"key", nil];
NSNotification *o1 = [NSNotification notificationWithName: @"hello"
@ -34,18 +33,19 @@ int main()
NSNotification *o2 = [NSNotification notificationWithName: @"hello"
object: @"there"
userInfo: info];
PASS([o1 hash] == [o2 hash], "equal notification hashes")
PASS_EQUAL(o1, o2, "equal notifications")
test_alloc(@"NSNotification");
obj = [NSNotification new];
obj = AUTORELEASE([NSNotification new]);
[testObjs addObject: obj];
test_NSObject(@"NSNotification", testObjs);
test_NSCoding(testObjs);
test_keyed_NSCoding(testObjs);
test_NSCopying(@"NSNotification",@"NSNotification",testObjs,NO,NO);
[arp release]; arp = nil;
LEAVE_POOL
return 0;
}