Revert "Release objects when we are done with them."

This reverts commit 9fda83ec82.
This commit is contained in:
rfm 2024-11-15 16:07:31 +00:00
parent 9fda83ec82
commit 7e59defb89

View file

@ -51,22 +51,14 @@
PASS(obj0 != nil, "%s has working alloc", prefix); \
PASS([obj0 isKindOfClass: theClass], \
"%s alloc gives the correct class", prefix); \
DESTROY(obj0); \
\
obj0 = [[theClass alloc] init]; \
PASS([obj0 isKindOfClass: theClass], "%s has working init", prefix); \
DESTROY(obj0); \
\
obj0 = [theClass new]; \
PASS([obj0 isKindOfClass: theClass], "%s has working new", prefix); \
DESTROY(obj0); \
\
obj1 = [theClass allocWithZone: testZone]; \
PASS([obj1 isKindOfClass: theClass],"%s has working allocWithZone",prefix); \
PASS([obj1 isKindOfClass: theClass], \
"%s allocWithZone: gives the correct class", prefix); \
DESTROY(obj1); \
NSRecycleZone(testZone); \
}
static void test_alloc(NSString *CN) __attribute__ ((unused));
static void test_alloc(NSString *CN)
@ -102,11 +94,8 @@ static void test_alloc(NSString *CN)
NSInvalidArgumentException, \
"returns nil or raises NSInvalidArgumentException in new") \
\
DESTROY(obj0); \
obj1 = [theClass allocWithZone: testZone]; \
PASS([obj1 isKindOfClass: theClass],"%s has working allocWithZone",prefix); \
DESTROY(obj1); \
NSRecycleZone(testZone); \
}
static void test_alloc_only(NSString *CN) __attribute__ ((unused));
static void test_alloc_only(NSString *CN)
@ -222,7 +211,6 @@ static void test_NSObject(NSString *CN, NSArray *OJS)
decoded = [NSUnarchiver unarchiveObjectWithData: data]; \
PASS(decoded != nil, "can be decoded"); \
PASS_EQUAL(decoded, obj, "decoded object equals the original"); \
DESTROY(archiver); \
END_SET(buf) \
} \
}
@ -359,7 +347,6 @@ static void test_keyed_NSCoding(NSArray *OJS)
"%s result of copy is not immutable", prefix); \
} \
\
DESTROY(theCopy); \
theCopy = [theObj copyWithZone: testZone]; \
PASS(theCopy != nil, "%s understands -copyWithZone", prefix); \
PASS([theCopy isKindOfClass: iClass], \
@ -382,7 +369,6 @@ static void test_keyed_NSCoding(NSArray *OJS)
if (theClass != iClass) \
PASS(![theCopy isKindOfClass: theClass], \
"%s result of copyWithZone: is not immutable", prefix); \
DESTROY(theCopy); \
END_SET(buf) \
} \
}
@ -461,7 +447,6 @@ static void test_NSCopying(
PASS(theCopy != theObj, \
"%s not retained by mutable copy in the same zone", \
[mClassName UTF8String]); \
DESTROY(theCopy); \
\
theCopy = [theObj mutableCopyWithZone: testZone]; \
PASS(theCopy != nil, \
@ -469,7 +454,6 @@ static void test_NSCopying(
PASS(theCopy != theObj, \
"%s not retained by mutable copy in other zone", \
[mClassName UTF8String]); \
DESTROY(theCopy); \
END_SET(buf) \
} \
}