2011-09-28 18:10:18 +00:00
|
|
|
#import "ObjectTesting.h"
|
|
|
|
#import <Foundation/NSAutoreleasePool.h>
|
|
|
|
#import <Foundation/NSXMLNode.h>
|
2012-01-06 09:24:51 +00:00
|
|
|
|
2011-09-28 18:10:18 +00:00
|
|
|
int main()
|
|
|
|
{
|
|
|
|
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
2012-01-06 09:24:51 +00:00
|
|
|
NSXMLNode *node;
|
|
|
|
NSXMLNode *other;
|
2011-09-28 18:10:18 +00:00
|
|
|
|
2011-10-01 18:43:29 +00:00
|
|
|
node = [[NSXMLNode alloc] initWithKind: NSXMLInvalidKind];
|
2011-09-28 18:10:18 +00:00
|
|
|
test_alloc(@"NSXMLNode");
|
|
|
|
test_NSObject(@"NSXMLNode", [NSArray arrayWithObject: node]);
|
2012-01-06 09:24:51 +00:00
|
|
|
|
|
|
|
other = [[NSXMLNode alloc] initWithKind: NSXMLElementKind];
|
|
|
|
PASS(NO == [other isEqual: node], "different node kinds are not equal");
|
|
|
|
[other release];
|
|
|
|
|
|
|
|
other = [[NSXMLNode alloc] initWithKind: NSXMLInvalidKind];
|
|
|
|
PASS([other isEqual: node], "empty nodes are equal");
|
|
|
|
[node release];
|
|
|
|
|
|
|
|
[other setName: @"other"];
|
|
|
|
PASS(nil == [other name], "setting name on invalid node gives a nil name");
|
|
|
|
[other release];
|
|
|
|
|
2011-09-28 18:10:18 +00:00
|
|
|
[arp release];
|
|
|
|
arp = nil;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|