dbertoni 2002/12/18 09:22:20
Modified: c/Tests/Params Params.cpp
Log:
Changes for C++ namespaces support.
Revision Changes Path
1.22 +34 -9 xml-xalan/c/Tests/Params/Params.cpp
Index: Params.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/Params/Params.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- Params.cpp 27 Nov 2002 22:36:28 -0000 1.21
+++ Params.cpp 18 Dec 2002 17:22:20 -0000 1.22
@@ -78,6 +78,10 @@
+#include <PlatformSupport/XalanUnicode.hpp>
+
+
+
#include <XSLT/XSLTInputSource.hpp>
#include <XSLT/XSLTResultTarget.hpp>
@@ -99,6 +103,11 @@
+XALAN_USING_XALAN(FileUtility)
+XALAN_USING_XALAN(XalanDOMString)
+
+
+
void
setHelp(FileUtility& h)
{
@@ -112,17 +121,19 @@
<< endl;
}
+
+
// This function returns the testcase number. All of these tests are
called
// params0X, and there are only 6 of them, so we can pick off the
// second X to determine what test number we're dealing with. We need to
// know which test because each test gets different parameters. This code
will
// need modification if the number of tests changes.
-unsigned short
-getTestNumber(const XalanDOMString& theFile)
+int
+getTestNumber(const XalanDOMString& theFile)
{
- assert(8 < length(theFile));
+ assert(8 < theFile.length());
- return charAt(theFile, 7) - XalanUnicode::charDigit_0;
+ return theFile[7] - XALAN_CPP_NAMESPACE_QUALIFIER
XalanUnicode::charDigit_0;
}
@@ -134,6 +145,8 @@
{
int theResult = 0;
+ XALAN_USING_XALAN(HarnessInit)
+
HarnessInit xmlPlatformUtils;
FileUtility h;
@@ -155,13 +168,16 @@
// Check that the base directory is correct.
if ( !h.checkDir(extDir) )
{
- cout << "Invalid base directory - " <<
c_str(TranscodeToLocalCodePage(extDir)) << endl;
+ cout << "Invalid base directory - " << extDir << endl;
cout << h.args.getHelpMessage();
theResult = -1;
}
else
{
+ XALAN_USING_XALAN(XalanTransformer)
+ XALAN_USING_XALAN(XMLFileReporter)
+
XalanTransformer xalan;
// Generate Unique Run id. (Only used to name the
result logfile.)
@@ -172,7 +188,7 @@
const XalanDOMString resultFilePrefix("params");
const XalanDOMString resultsFile(drive +
h.args.output + resultFilePrefix + UniqRunid + FileUtility::s_xmlSuffix);
- XMLFileReporter logFile(resultsFile);
+ XMLFileReporter logFile(resultsFile);
logFile.logTestFileInit("Param Testing: Testing ability
to pass parameters to stylesheets. ");
@@ -186,6 +202,8 @@
// Check that output directory is there.
h.checkAndCreateDir(theOutputDir);
+ typedef FileUtility::FileNameVectorType
FileNameVectorType;
+
const FileNameVectorType files =
h.getTestFileNames(h.args.base, currentDir, true);
logFile.logTestCaseInit(currentDir);
@@ -205,7 +223,7 @@
// Testcase 8 tests: <?xml-stylesheet
type="text/xsl" href="foo.xsl"?>
if ( i+1 <= 6 )
{
- assign(theXMLFile,
h.generateFileName(theXSLFile,"xml"));
+ theXMLFile =
h.generateFileName(theXSLFile, "xml");
}
h.data.xmlFileURL = theXMLFile;
@@ -216,6 +234,9 @@
theGoldFile = h.args.gold + currentDir
+ FileUtility::s_pathSep + fileName;
theGoldFile =
h.generateFileName(theGoldFile, "out");
+ XALAN_USING_XALAN(XSLTResultTarget);
+ XALAN_USING_XALAN(XSLTInputSource);
+
const XSLTResultTarget
theResultTarget(theOutputFile);
const XSLTInputSource
xslInputSource(theXSLFile);
const XSLTInputSource
xmlInputSource(theXMLFile);
@@ -249,7 +270,7 @@
{
const
XSLTInputSource embed07InputSource(theXSLFile);
xalan.transform(embed07InputSource, theResultTarget);
-
append(h.data.testOrFile, " (Embed01)" );
+
h.data.testOrFile += XALAN_STATIC_UCODE_STRING(" (Embed01)");
embedFlag =
true;
break;
}
@@ -258,7 +279,7 @@
{
const
XSLTInputSource embed08InputSource(theXSLFile);
xalan.transform(embed08InputSource, theResultTarget);
-
append(h.data.testOrFile, " (Embed02)" );
+
h.data.testOrFile += XALAN_STATIC_UCODE_STRING(" (Embed02)");
embedFlag =
true;
break;
}
@@ -316,6 +337,10 @@
try
{
+ XALAN_USING_XERCES(XMLPlatformUtils)
+
+ XALAN_USING_XALAN(XalanTransformer)
+
// Call the static initializers for xerces and xalan, and
create a transformer
//
XMLPlatformUtils::Initialize();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]