mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Improve nsxmlplarser test
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27633 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
41d1c8eb6e
commit
b229bbb710
1 changed files with 14 additions and 4 deletions
|
@ -65,12 +65,19 @@
|
|||
if (startElem == 0)
|
||||
{
|
||||
startElem++;
|
||||
if ([anElementName isEqual: @"example"] == NO)
|
||||
if ([anElementName isEqual: @"example"] == NO) {
|
||||
problem = YES;
|
||||
NSLog(@"Bad start element '%@' in namespace '%@' '%@' attributes '%@'",
|
||||
anElementName, aNamespaceURI, aQualifierName, anAttributeDict);
|
||||
}
|
||||
if ([aQualifierName isEqual: @"foo:example"] == NO) {
|
||||
problem = YES;
|
||||
NSLog(@"Bad qualified name '%@'", aQualifierName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
problem = YES;
|
||||
NSLog(@"Extra start element '%@' in namespace '%@' '%@' attributes '%@'",
|
||||
anElementName, aNamespaceURI, aQualifierName, anAttributeDict);
|
||||
}
|
||||
|
@ -85,12 +92,15 @@
|
|||
if (endElem == 0)
|
||||
{
|
||||
endElem++;
|
||||
if ([anElementName isEqual: @"example"] == NO)
|
||||
if ([anElementName isEqual: @"example"] == NO) {
|
||||
problem = YES;
|
||||
NSLog(@"Bad end element '%@' in namespace '%@' '%@'",
|
||||
anElementName, aNamespaceURI, aQualifierName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
problem = YES;
|
||||
NSLog(@"Extra end element '%@' in namespace '%@' '%@'",
|
||||
anElementName, aNamespaceURI, aQualifierName);
|
||||
}
|
||||
|
@ -107,8 +117,8 @@ int main ()
|
|||
NSXMLParser *parser;
|
||||
const char *str =
|
||||
"<?xml version=\"1.0\"?>"
|
||||
"<example>"
|
||||
"</example>";
|
||||
"<foo:example>"
|
||||
"</foo:example>";
|
||||
|
||||
document = [NSData dataWithBytes: str length: strlen(str)];
|
||||
parser = [[NSXMLParser alloc] initWithData: document];
|
||||
|
|
Loading…
Reference in a new issue