Skip to content

Commit

Permalink
Fixing some memory leaks in the unit tests. (Thanks analyzer.)
Browse files Browse the repository at this point in the history
  • Loading branch information
robbiehanson committed Apr 14, 2011
1 parent 4608499 commit 55edeb9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions DDXMLTesting.m
Expand Up @@ -628,8 +628,8 @@ + (void)testChildren
[xmlStr appendString:@" <!-- budweiser -->"];
[xmlStr appendString:@"</beers> "];

NSXMLDocument *nsDoc = [[NSXMLDocument alloc] initWithXMLString:xmlStr options:0 error:nil];
DDXMLDocument *ddDoc = [[DDXMLDocument alloc] initWithXMLString:xmlStr options:0 error:nil];
NSXMLDocument *nsDoc = [[[NSXMLDocument alloc] initWithXMLString:xmlStr options:0 error:nil] autorelease];
DDXMLDocument *ddDoc = [[[DDXMLDocument alloc] initWithXMLString:xmlStr options:0 error:nil] autorelease];

NSUInteger nsChildCount = [[nsDoc rootElement] childCount];
NSUInteger ddChildCount = [[ddDoc rootElement] childCount];
Expand Down Expand Up @@ -765,8 +765,8 @@ + (void)testPreviousNextNode2
[xmlStr appendString:@" </crust> "];
[xmlStr appendString:@"</pizza> "];

NSXMLDocument *nsDoc = [[NSXMLDocument alloc] initWithXMLString:xmlStr options:0 error:nil];
DDXMLDocument *ddDoc = [[DDXMLDocument alloc] initWithXMLString:xmlStr options:0 error:nil];
NSXMLDocument *nsDoc = [[[NSXMLDocument alloc] initWithXMLString:xmlStr options:0 error:nil] autorelease];
DDXMLDocument *ddDoc = [[[DDXMLDocument alloc] initWithXMLString:xmlStr options:0 error:nil] autorelease];

NSXMLNode *nsNode0 = [nsDoc rootElement]; // pizza
DDXMLNode *ddNode0 = [ddDoc rootElement]; // pizza
Expand Down Expand Up @@ -1008,10 +1008,10 @@ + (void)testXmlns
NSString *parseMe = @"<query xmlns=\"jabber:iq:roster\"></query>";
NSData *data = [parseMe dataUsingEncoding:NSUTF8StringEncoding];

NSXMLDocument *nsDoc = [[NSXMLDocument alloc] initWithData:data options:0 error:nil];
NSXMLDocument *nsDoc = [[[NSXMLDocument alloc] initWithData:data options:0 error:nil] autorelease];
NSXMLElement *nsRootElement = [nsDoc rootElement];

DDXMLDocument *ddDoc = [[DDXMLDocument alloc] initWithData:data options:0 error:nil];
DDXMLDocument *ddDoc = [[[DDXMLDocument alloc] initWithData:data options:0 error:nil] autorelease];
DDXMLElement *ddRootElement = [ddDoc rootElement];

// Both URI and namespaceForPrefix:@"" should return "jabber:iq:roster"
Expand Down

0 comments on commit 55edeb9

Please sign in to comment.