add trivial document tests

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34422 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2012-01-05 18:52:57 +00:00
parent 7620644234
commit b9ce94a828
2 changed files with 28 additions and 0 deletions

View file

View file

@ -0,0 +1,28 @@
#import "ObjectTesting.h"
#import <Foundation/NSAutoreleasePool.h>
#import <Foundation/NSXMLDocument.h>
int main()
{
NSAutoreleasePool *arp = [NSAutoreleasePool new];
NSXMLDocument *node;
node = [NSXMLDocument alloc];
PASS_EXCEPTION([node initWithDate: nil options: 0 error: 0],
NSInvalidArgumentException,
"Cannot initialise an XML document with nil data");
node = [NSXMLDocument alloc];
PASS_EXCEPTION([node initWithDate: (NSData*)@"bad" options: 0 error: 0],
NSInvalidArgumentException,
"Cannot initialise an XML document with bad data class");
node = [[NSXMLDocument alloc] init];
test_alloc(@"NSXMLNode");
test_NSObject(@"NSXMLNode", [NSArray arrayWithObject: node]);
[arp release];
arp = nil;
[node release];
return 0;
}