More leak management fixes

This commit is contained in:
rfm 2024-11-17 16:16:46 +00:00
parent 90082eccac
commit cd3e69245d
9 changed files with 119 additions and 79 deletions

View file

@ -11,10 +11,10 @@ int main()
httpURL = [NSURL URLWithString: @"http://www.gnustep.org"];
TEST_FOR_CLASS(@"NSURLProtocol", [NSURLProtocol alloc],
TEST_FOR_CLASS(@"NSURLProtocol", AUTORELEASE([NSURLProtocol alloc]),
"NSURLProtocol +alloc returns an NSURLProtocol");
mutable = [[NSMutableURLRequest requestWithURL: httpURL] retain];
mutable = [NSMutableURLRequest requestWithURL: httpURL];
PASS_EXCEPTION([NSURLProtocol canInitWithRequest: mutable], nil,
"NSURLProtocol +canInitWithRequest throws an exeception (subclasses should be used)");
@ -22,13 +22,12 @@ int main()
TEST_FOR_CLASS(@"NSURLRequest", canon,
"NSURLProtocol +canonicalRequestForRequest: returns an NSURLProtocol");
copy = [mutable copy];
copy = AUTORELEASE([mutable copy]);
PASS([NSURLProtocol requestIsCacheEquivalent: mutable toRequest: copy],
"NSURLProtocol +requestIsCacheEquivalent:toRequest returns YES with a request and its copy");
[copy setHTTPMethod: @"POST"];
PASS([NSURLProtocol requestIsCacheEquivalent: mutable toRequest: copy] == NO,
"NSURLProtocol +requestIsCacheEquivalent:toRequest returns NO after a method change");
[copy release];
[arp release]; arp = nil;
return 0;