mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 09:41:15 +00:00
Add test for child de-/re-attachment behaviour in NSXML.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33920 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
223eb3356c
commit
4432b3d54d
3 changed files with 37 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2011-09-28 Niels Grewe <niels.grewe@halbordnung.de>
|
||||
|
||||
* Tests/base/NSXMLNode/children.m: Test for child de-/re-attachment
|
||||
behaviour.
|
||||
|
||||
2011-09-29 julian <julian@corecode.at>
|
||||
|
||||
* Source/NSBundle.m: ([objectForInfoDictionaryKey:])
|
||||
|
|
31
Tests/base/NSXMLNode/children.m
Normal file
31
Tests/base/NSXMLNode/children.m
Normal file
|
@ -0,0 +1,31 @@
|
|||
#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;
|
||||
[node detach];
|
||||
PASS(docB = [[NSXMLDocument alloc] initWithRootElement: node], "Detached children can be reattached.");
|
||||
[docA release];
|
||||
[docB release];
|
||||
docA = [[NSXMLDocument alloc] initWithRootElement: node];
|
||||
PASS_EXCEPTION(docB = [[NSXMLDocument alloc] initWithRootElement: node], NSInternalInconsistencyException, "Reusing a child throws an exception");
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
PASS (0 == 1, "NSXML child handling working.");
|
||||
}
|
||||
NS_ENDHANDLER
|
||||
END_SET("NSXMLNode - handling children")
|
||||
return 0;
|
||||
}
|
|
@ -35,7 +35,7 @@ int main()
|
|||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
PASS(YES == NO, "Failed testing NSXMLNode kinds");
|
||||
PASS(YES == NO, "NSXMLNode kinds working");
|
||||
}
|
||||
NS_ENDHANDLER
|
||||
[arp release];
|
||||
|
|
Loading…
Reference in a new issue