Add Yavor Doganov's patches for tests and config. Add fixes for GSXML

validation of xml documents
This commit is contained in:
Richard Frith-Macdonald 2018-01-14 12:30:13 +00:00
parent 31257785d6
commit 925f1dd5e1
19 changed files with 260 additions and 98 deletions

View file

@ -2,10 +2,15 @@
#import <Foundation/NSAutoreleasePool.h>
#import <Foundation/NSXMLNode.h>
#import <Foundation/NSValue.h>
#import "GNUstepBase/GSConfig.h"
int main()
{
NSAutoreleasePool *arp = [NSAutoreleasePool new];
START_SET("NSXMLNode")
#if !GS_USE_LIBXML
SKIP("library built without libxml2")
#else
NSXMLNode *node;
NSXMLNode *other;
NSXMLNode *text;
@ -111,7 +116,9 @@ int main()
[attr setStringValue: @"aString"];
PASS_EQUAL([attr stringValue], @"aString",
"setting string value on attr node works");
#endif
END_SET("NSXMLNode")
[arp release];
arp = nil;

View file

@ -3,11 +3,14 @@
#import <Foundation/NSXMLNode.h>
#import <Foundation/NSXMLDocument.h>
#import <Foundation/NSXMLElement.h>
#import "GNUstepBase/GSConfig.h"
int main()
{
START_SET("NSXMLNode - handling children")
#if !GS_USE_LIBXML
SKIP("library built without libxml2")
#else
NS_DURING
{
NSXMLElement *node = [[NSXMLElement alloc] initWithKind: NSXMLElementKind];
@ -54,6 +57,7 @@ int main()
PASS (0 == 1, "NSXML child handling working."); // I don't think this is valid... commenting out for now.
}
NS_ENDHANDLER
#endif
END_SET("NSXMLNode - handling children")
return 0;
}

View file

@ -5,6 +5,7 @@
*/
#import <Foundation/Foundation.h>
#import "GNUstepBase/GSConfig.h"
int
main(int argc, const char *argv[])
@ -18,7 +19,9 @@ main(int argc, const char *argv[])
START_SET("NSXMLNode - descriptions")
#if !GS_USE_LIBXML
SKIP("library built without libxml2")
#else
xmlDocStr = @"<?xml version=\"1.0\" encoding=\"utf-8\"?><env:Envelope xmlns:env=\"http://myurl/mypath/envelope\"><InvokeStampatore xmlns=\"http://tempuri.org/\"> <Flusso><IdFlusso>DF247309-57F8-4CDB-8711-6E9DB69BCE74</IdFlusso><Sorgente>FOX/EDI</Sorgente><DataRichiesta>2012-06-26T17:00:00.717</DataRichiesta><OraRichiesta>17:00</OraRichiesta> <NumeroDocumenti>10</NumeroDocumenti><Lettera><IdCrm>FakeField</IdCrm><TipoDocumento>1001</TipoDocumento><DataDocumento>2012-06-26T14:45:08.673Z</DataDocumento><Utente>FakeUser</Utente><Priorita>Normale</Priorita><PraticaName>FakeName</PraticaName><ContentHeader> <fieldList> <Field><name>Campaign.Name</name> <value>Campagna ENP</value></Field><Field><name>Cliente.Cap</name><value>37053</value></Field></fieldList></ContentHeader></Lettera></Flusso></InvokeStampatore></env:Envelope>";
xmlDoc = [[NSXMLDocument alloc] initWithXMLString:xmlDocStr options:0 error:error];
@ -33,7 +36,7 @@ main(int argc, const char *argv[])
[[[rootElement children] objectAtIndex: 0] description],
@"<InvokeStampatore xmlns=\"http://tempuri.org/\"><Flusso><IdFlusso>DF247309-57F8-4CDB-8711-6E9DB69BCE74</IdFlusso><Sorgente>FOX/EDI</Sorgente><DataRichiesta>2012-06-26T17:00:00.717</DataRichiesta><OraRichiesta>17:00</OraRichiesta><NumeroDocumenti>10</NumeroDocumenti><Lettera><IdCrm>FakeField</IdCrm><TipoDocumento>1001</TipoDocumento><DataDocumento>2012-06-26T14:45:08.673Z</DataDocumento><Utente>FakeUser</Utente><Priorita>Normale</Priorita><PraticaName>FakeName</PraticaName><ContentHeader><fieldList><Field><name>Campaign.Name</name><value>Campagna ENP</value></Field><Field><name>Cliente.Cap</name><value>37053</value></Field></fieldList></ContentHeader></Lettera></Flusso></InvokeStampatore>",
"child description");
#endif
END_SET("NSXMLNode - descriptions")
return 0;

View file

@ -5,6 +5,7 @@
#import <Foundation/NSXMLElement.h>
#import <Foundation/NSXMLDTD.h>
#import <Foundation/NSXMLDTDNode.h>
#import "GNUstepBase/GSConfig.h"
#define NODE_KIND_HAS_CLASS(node, kind, theClass) \
do \
@ -18,6 +19,9 @@
int main()
{
START_SET("NSXMLNode -initWithKind: initializer")
#if !GS_USE_LIBXML
SKIP("library built without libxml2")
#else
NSAutoreleasePool *arp = [NSAutoreleasePool new];
NSXMLNode *node;
NS_DURING
@ -39,6 +43,7 @@ int main()
NS_ENDHANDLER
[arp release];
arp = nil;
#endif
END_SET("NSXMLNode -initWithKind: initializer")
return 0;
}

View file

@ -19,6 +19,7 @@
#import <Foundation/NSXMLNode.h>
#import <Foundation/NSXMLDocument.h>
#import <Foundation/NSXMLElement.h>
#import "GNUstepBase/GSConfig.h"
NSString *kGDataNamespaceGData = @"http://schemas.google.com/g/2005";
NSString *kGDataNamespaceBatch = @"http://schemas.google.com/gdata/batch";
@ -29,6 +30,9 @@ NSString *kGDataNamespaceAtomPrefix = @"atom";
int main()
{
START_SET("NSXMLNode namespace handling")
#if !GS_USE_LIBXML
SKIP("library built without libxml2")
#else
NSAutoreleasePool *arp = [NSAutoreleasePool new];
// create elements and attributes
@ -180,6 +184,7 @@ int main()
[arp drain];
arp = nil;
#endif
END_SET("NSXMLNode namespace handling")
return 0;
}