-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
3 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
2011-09-28 Niels Grewe <[email protected]> | ||
|
||
* Tests/base/NSXMLNode/children.m: Test for child de-/re-attachment | ||
behaviour. | ||
|
||
2011-09-29 julian <[email protected]> | ||
|
||
* Source/NSBundle.m: ([objectForInfoDictionaryKey:]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters