You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by am...@apache.org on 2008/07/17 13:51:40 UTC
svn commit: r677563 - in /xerces/c/trunk/tests/src/XSTSHarness:
XSTSHarness.cpp XSTSHarnessHandlers.cpp XSTSHarnessHandlers.hpp
Author: amassari
Date: Thu Jul 17 04:51:39 2008
New Revision: 677563
URL: http://svn.apache.org/viewvc?rev=677563&view=rev
Log:
The XSTS schema allows multiple schema files to be loaded before a test
Modified:
xerces/c/trunk/tests/src/XSTSHarness/XSTSHarness.cpp
xerces/c/trunk/tests/src/XSTSHarness/XSTSHarnessHandlers.cpp
xerces/c/trunk/tests/src/XSTSHarness/XSTSHarnessHandlers.hpp
Modified: xerces/c/trunk/tests/src/XSTSHarness/XSTSHarness.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/tests/src/XSTSHarness/XSTSHarness.cpp?rev=677563&r1=677562&r2=677563&view=diff
==============================================================================
--- xerces/c/trunk/tests/src/XSTSHarness/XSTSHarness.cpp (original)
+++ xerces/c/trunk/tests/src/XSTSHarness/XSTSHarness.cpp Thu Jul 17 04:51:39 2008
@@ -115,6 +115,7 @@
//
SAX2XMLReader* parser = XMLReaderFactory::createXMLReader();
parser->setFeature(XMLUni::fgSAX2CoreNameSpaces, true);
+ parser->setFeature(XMLUni::fgSAX2CoreValidation, false);
const char* xmlFile = argV[argInd];
//
Modified: xerces/c/trunk/tests/src/XSTSHarness/XSTSHarnessHandlers.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/tests/src/XSTSHarness/XSTSHarnessHandlers.cpp?rev=677563&r1=677562&r2=677563&view=diff
==============================================================================
--- xerces/c/trunk/tests/src/XSTSHarness/XSTSHarnessHandlers.cpp (original)
+++ xerces/c/trunk/tests/src/XSTSHarness/XSTSHarnessHandlers.cpp Thu Jul 17 04:51:39 2008
@@ -131,7 +131,7 @@
fCurrentTest.fSpecReference.setURL(urlW3C);
fCurrentTest.fTestName[0]=0;
fCurrentTest.fXMLName.setURL(dummy);
- fCurrentTest.fXSDName.setURL(dummy);
+ fCurrentTest.fXSDNames.removeAllElements();
StrX x(attrs.getValue(szNAME));
const char* groupName=x.localForm();
if(XMLString::equals(groupName,"isDefault072") || // this fails because of an access violation
@@ -166,7 +166,7 @@
}
else if(XMLString::equals(localname, szSchemaDocument))
{
- fCurrentTest.fXSDName.setURL(fBaseURL, attrs.getValue(szXLINK, szHREF));
+ fCurrentTest.fXSDNames.addElement(new XMLURL(fBaseURL, attrs.getValue(szXLINK, szHREF)));
}
else if(XMLString::equals(localname, szInstanceDocument))
{
@@ -204,8 +204,11 @@
try
{
fErrorHandler.resetErrors();
- Grammar* grammar=fParser->loadGrammar(fCurrentTest.fXSDName.getURLText(), Grammar::SchemaGrammarType, true);
- success=(grammar!=NULL);
+ for(unsigned int i=0;i<fCurrentTest.fXSDNames.size();i++)
+ {
+ Grammar* grammar=fParser->loadGrammar(fCurrentTest.fXSDNames.elementAt(i)->getURLText(), Grammar::SchemaGrammarType, true);
+ success=(success && (grammar!=NULL));
+ }
}
catch (const OutOfMemoryException&)
{
@@ -231,7 +234,8 @@
// skip the rest of the group, as we had problems with the schema itself
fCurrentTest.fSkipped=true;
fFailures++;
- printFile(fCurrentTest.fXSDName);
+ for(unsigned int i=0;i<fCurrentTest.fXSDNames.size();i++)
+ printFile(*fCurrentTest.fXSDNames.elementAt(i));
}
else
{
@@ -243,7 +247,8 @@
fCurrentTest.fSkipped=true;
fFailures++;
XERCES_STD_QUALIFIER cout << "Test " << StrX(fCurrentTest.fTestName) << " succeeded but was expected to fail" << XERCES_STD_QUALIFIER endl;
- printFile(fCurrentTest.fXSDName);
+ for(unsigned int i=0;i<fCurrentTest.fXSDNames.size();i++)
+ printFile(*fCurrentTest.fXSDNames.elementAt(i));
}
}
else
@@ -255,7 +260,8 @@
fFailures++;
XERCES_STD_QUALIFIER cout << "Test " << StrX(fCurrentTest.fTestName) << " failed but was expected to pass" << XERCES_STD_QUALIFIER endl;
XERCES_STD_QUALIFIER cout << "Reported error: " << StrX(fErrorHandler.getErrorText()) << XERCES_STD_QUALIFIER endl;
- printFile(fCurrentTest.fXSDName);
+ for(unsigned int i=0;i<fCurrentTest.fXSDNames.size();i++)
+ printFile(*fCurrentTest.fXSDNames.elementAt(i));
}
}
}
@@ -297,7 +303,8 @@
if(fatalFailure)
{
fFailures++;
- printFile(fCurrentTest.fXSDName);
+ for(unsigned int i=0;i<fCurrentTest.fXSDNames.size();i++)
+ printFile(*fCurrentTest.fXSDNames.elementAt(i));
printFile(fCurrentTest.fXMLName);
}
else
@@ -308,7 +315,8 @@
{
fFailures++;
XERCES_STD_QUALIFIER cout << "Test " << StrX(fCurrentTest.fTestName) << " succeeded but was expected to fail" << XERCES_STD_QUALIFIER endl;
- printFile(fCurrentTest.fXSDName);
+ for(unsigned int i=0;i<fCurrentTest.fXSDNames.size();i++)
+ printFile(*fCurrentTest.fXSDNames.elementAt(i));
printFile(fCurrentTest.fXMLName);
}
}
@@ -319,7 +327,8 @@
fFailures++;
XERCES_STD_QUALIFIER cout << "Test " << StrX(fCurrentTest.fTestName) << " failed but was expected to pass" << XERCES_STD_QUALIFIER endl;
XERCES_STD_QUALIFIER cout << "Reported error: " << StrX(fErrorHandler.getErrorText()) << XERCES_STD_QUALIFIER endl;
- printFile(fCurrentTest.fXSDName);
+ for(unsigned int i=0;i<fCurrentTest.fXSDNames.size();i++)
+ printFile(*fCurrentTest.fXSDNames.elementAt(i));
printFile(fCurrentTest.fXMLName);
}
}
Modified: xerces/c/trunk/tests/src/XSTSHarness/XSTSHarnessHandlers.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/tests/src/XSTSHarness/XSTSHarnessHandlers.hpp?rev=677563&r1=677562&r2=677563&view=diff
==============================================================================
--- xerces/c/trunk/tests/src/XSTSHarness/XSTSHarnessHandlers.hpp (original)
+++ xerces/c/trunk/tests/src/XSTSHarness/XSTSHarnessHandlers.hpp Thu Jul 17 04:51:39 2008
@@ -27,6 +27,7 @@
#include <xercesc/sax2/Attributes.hpp>
#include <xercesc/sax2/DefaultHandler.hpp>
#include <xercesc/util/XMLURL.hpp>
+#include <xercesc/util/RefVectorOf.hpp>
XERCES_CPP_NAMESPACE_USE
@@ -71,11 +72,20 @@
valid
} ValidityOutcome;
-struct XSTSTest
+class XSTSTest
{
+public:
+ XSTSTest() :
+ fXSDNames(1)
+ {
+ fTestName[0]=0;
+ fExpectedResult=unknown;
+ fSkipped=false;
+ }
+
XMLCh fTestName[256];
- XMLURL fXSDName,
- fXMLName;
+ RefVectorOf<XMLURL> fXSDNames;
+ XMLURL fXMLName;
ValidityOutcome fExpectedResult;
XMLURL fSpecReference;
bool fSkipped;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org