mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
add basic equality tests
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34436 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8b518f58ee
commit
58678e6176
3 changed files with 45 additions and 2 deletions
|
@ -1,17 +1,31 @@
|
|||
#import "ObjectTesting.h"
|
||||
#import <Foundation/NSAutoreleasePool.h>
|
||||
#import <Foundation/NSXMLNode.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
NSXMLNode *node;
|
||||
NSXMLNode *node;
|
||||
NSXMLNode *other;
|
||||
|
||||
node = [[NSXMLNode alloc] initWithKind: NSXMLInvalidKind];
|
||||
test_alloc(@"NSXMLNode");
|
||||
test_NSObject(@"NSXMLNode", [NSArray arrayWithObject: node]);
|
||||
|
||||
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];
|
||||
|
||||
[arp release];
|
||||
arp = nil;
|
||||
|
||||
[node release];
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue