mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-05 14:11:00 +00:00
* Source/NSXMLNode.m>: Minor correction. Move setName out of private category. * Tests/base/NSXMLNode/children.m: Update test. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34385 72102866-910b-0410-8b05-ffd578937521
35 lines
1.1 KiB
Objective-C
35 lines
1.1 KiB
Objective-C
#import "Testing.h"
|
|
#import <Foundation/NSAutoreleasePool.h>
|
|
#import <Foundation/NSXMLNode.h>
|
|
#import <Foundation/NSXMLDocument.h>
|
|
#import <Foundation/NSXMLElement.h>
|
|
|
|
|
|
int main()
|
|
{
|
|
START_SET("NSXMLNode - handling children")
|
|
// testHopeful = YES;
|
|
NS_DURING
|
|
{
|
|
NSXMLElement *node = [[NSXMLElement alloc] initWithKind: NSXMLElementKind];
|
|
NSXMLDocument *docA = [[NSXMLDocument alloc] initWithRootElement: node];
|
|
NSXMLDocument *docB = nil;
|
|
// NSLog(@"Here...");
|
|
[node detach];
|
|
PASS(docB = [[NSXMLDocument alloc] initWithRootElement: node], "Detached children can be reattached.");
|
|
[docA release];
|
|
// NSLog(@"Here... again");
|
|
[docB release];
|
|
docA = [[NSXMLDocument alloc] initWithRootElement: node];
|
|
// NSLog(@"Yet again");
|
|
PASS_EXCEPTION(docB = [[NSXMLDocument alloc] initWithRootElement: node], NSInternalInconsistencyException, "Reusing a child throws an exception");
|
|
// NSLog(@"Last time");
|
|
}
|
|
NS_HANDLER
|
|
{
|
|
// PASS (0 == 1, "NSXML child handling working."); // I don't think this is valid... commenting out for now.
|
|
}
|
|
NS_ENDHANDLER
|
|
END_SET("NSXMLNode - handling children")
|
|
return 0;
|
|
}
|