dbertoni 2002/11/27 14:36:29
Modified: c/Tests/Compare compare.cpp
c/Tests/Conf conf.cpp
c/Tests/Dom2Dom dom2dom.cpp
c/Tests/Errortests Errortests.cpp
c/Tests/Extensions extensions.cpp
c/Tests/Harness FileUtility.cpp FileUtility.hpp
HarnessInit.cpp XMLFileReporter.hpp
c/Tests/InputSource inputsource.cpp
c/Tests/Memory Stressmem.cpp
c/Tests/Params Params.cpp
c/Tests/PerfT perft.cpp
c/Tests/Performance perf.cpp
c/Tests/Threads ThreadTest.cpp
c/Tests/Transformer TestXalanTransformer.cpp
Log:
Updates for C++ namespace support.
Revision Changes Path
1.16 +63 -21 xml-xalan/c/Tests/Compare/compare.cpp
Index: compare.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/Compare/compare.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- compare.cpp 30 Aug 2002 23:58:29 -0000 1.15
+++ compare.cpp 27 Nov 2002 22:36:27 -0000 1.16
@@ -55,36 +55,53 @@
* <http://www.apache.org/>.
*/
+// Base header file. Must be first.
+#include <Include/PlatformDefinitions.hpp>
+
+
+
+#if defined(XALAN_CLASSIC_IOSTREAMS)
+#include <iostream.h>
+#include <strstream.h>
+#else
#include <iostream>
#include <strstream>
+#endif
+
#include <cstdio>
-#include <direct.h>
-#if !defined(XALAN_NO_NAMESPACES)
- using std::cerr;
- using std::endl;
+#if defined(_MSC_VER)
+#include <direct.h>
#endif
+
+
+XALAN_USING_STD(cerr)
+XALAN_USING_STD(endl)
+
+
+
// XERCES HEADERS...
#include <xercesc/util/PlatformUtils.hpp>
+
+
// XALAN HEADERS...
#include <XalanSourceTree/FormatterToSourceTree.hpp>
#include <XalanSourceTree/XalanSourceTreeDOMSupport.hpp>
#include <XalanSourceTree/XalanSourceTreeParserLiaison.hpp>
+
+
#include <XalanTransformer/XalanTransformer.hpp>
-// HARNESS HEADERS...
+
+
#include <Harness/XMLFileReporter.hpp>
#include <Harness/FileUtility.hpp>
#include <Harness/HarnessInit.hpp>
-#if defined(XALAN_NO_NAMESPACES)
- typedef map<XalanDOMString, XalanDOMString, less<XalanDOMString> >
Hashtable;
-#else
- typedef std::map<XalanDOMString, XalanDOMString> Hashtable;
-#endif
+
// This is here for memory leak testing.
#if !defined(NDEBUG) && defined(_MSC_VER)
@@ -93,6 +110,10 @@
+XALAN_USING_XALAN(FileUtility)
+
+
+
void
setHelp(FileUtility& h)
{
@@ -115,7 +136,9 @@
int argc,
const char* argv[])
{
- HarnessInit xmlPlatformUtils;
+ XALAN_USING_XALAN(HarnessInit)
+
+ HarnessInit xmlPlatformUtils;
FileUtility h;
@@ -127,13 +150,25 @@
if (h.getParams(argc, argv, "DOMCOM-RESULTS", setGold) == true)
{
+ XALAN_USING_XALAN(FormatterToSourceTree)
+ XALAN_USING_XALAN(XalanCompiledStylesheet)
+ XALAN_USING_XALAN(XalanDOMString)
+ XALAN_USING_XALAN(XalanParsedSource)
+ XALAN_USING_XALAN(XalanSourceTreeDocument)
+ XALAN_USING_XALAN(XalanSourceTreeDOMSupport)
+ XALAN_USING_XALAN(XalanSourceTreeParserLiaison)
+ XALAN_USING_XALAN(XalanTransformer)
+ XALAN_USING_XALAN(XMLFileReporter)
+ XALAN_USING_XALAN(XSLTInputSource)
+ XALAN_USING_XALAN(XSLTResultTarget)
+
//
// Call the static initializers for xerces and xalan, and
create a transformer
//
- XalanTransformer xalan;
+ XalanTransformer xalan;
- XalanSourceTreeDOMSupport domSupport;
- XalanSourceTreeParserLiaison parserLiaison(domSupport);
+ XalanSourceTreeDOMSupport domSupport;
+ XalanSourceTreeParserLiaison parserLiaison(domSupport);
domSupport.setParserLiaison(&parserLiaison);
@@ -142,7 +177,7 @@
const XalanDOMString resultFilePrefix("cpp");
const XalanDOMString resultsFile(h.args.output +
resultFilePrefix + UniqRunid + FileUtility::s_xmlSuffix);
- XMLFileReporter logFile(resultsFile);
+ XMLFileReporter logFile(resultsFile);
logFile.logTestFileInit("Comparison Testing:");
// Specify the "test" directory for both input and output.
@@ -154,7 +189,10 @@
// Get the files found in the test directory
//
logFile.logTestCaseInit(currentDir);
- const FileNameVectorType files =
h.getTestFileNames(h.args.base, currentDir, true);
+
+ typedef FileUtility::FileNameVectorType
FileNameVectorType;
+
+ const FileNameVectorType files =
h.getTestFileNames(h.args.base, currentDir, true);
for(FileNameVectorType::size_type i = 0; i < files.size(); i++)
{
@@ -170,15 +208,15 @@
const XalanDOMString outbase = h.args.output +
currentDir + FileUtility::s_pathSep + fileName;
const XalanDOMString theOutputFile =
h.generateFileName(outbase, "out");
- const XSLTInputSource
xslInputSource(c_wstr(theXSLFile));
- const XSLTInputSource
xmlInputSource(c_wstr(theXMLFile));
- const XSLTInputSource
goldInputSource(c_wstr(theGoldFile));
+ const XSLTInputSource xslInputSource(theXSLFile);
+ const XSLTInputSource xmlInputSource(theXMLFile);
+ const XSLTInputSource goldInputSource(theGoldFile);
// Use a XalanSourceTreeDocument to create the
XSLTResultTarget.
//
XalanSourceTreeDocument* dom =
parserLiaison.createXalanSourceTreeDocument();
- FormatterToSourceTree domOut(dom);
- XSLTResultTarget domResultTarget;
+ FormatterToSourceTree domOut(dom);
+ XSLTResultTarget domResultTarget;
domResultTarget.setDocumentHandler(&domOut);
// Parsing(compile) the XSL stylesheet and report the
results..
@@ -237,6 +275,10 @@
try
{
+ XALAN_USING_XERCES(XMLPlatformUtils)
+
+ XALAN_USING_XALAN(XalanTransformer)
+
// Call the static initializers for xerces and xalan, and
create a transformer
//
XMLPlatformUtils::Initialize();
1.31 +16 -11 xml-xalan/c/Tests/Conf/conf.cpp
Index: conf.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/Conf/conf.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- conf.cpp 26 Nov 2002 02:12:22 -0000 1.30
+++ conf.cpp 27 Nov 2002 22:36:27 -0000 1.31
@@ -55,6 +55,11 @@
* <http://www.apache.org/>.
*/
+// Base header file. Must be first.
+#include <Include/PlatformDefinitions.hpp>
+
+
+
#if defined(XALAN_CLASSIC_IOSTREAMS)
#include <iostream.h>
#else
@@ -64,13 +69,10 @@
#include <cstdio>
-#if !defined(XALAN_NO_STD_NAMESPACE)
- using std::cerr;
- using std::cout;
- using std::cin;
- using std::endl;
- using std::ostringstream;
-#endif
+
+XALAN_USING_STD(cerr)
+XALAN_USING_STD(cout)
+XALAN_USING_STD(endl)
@@ -134,7 +136,7 @@
static const char* const excludeStylesheets[] =
{
- "output22.xsl", // Excluded because it outputs EBCDIC
+// "output22.xsl", // Excluded because it outputs EBCDIC
0
};
@@ -291,6 +293,8 @@
// Flag indicates directory found. Used in conjunction
with -sub cmd-line arg.
bool foundDir = false;
+ typedef FileUtility::FileNameVectorType
FileNameVectorType;
+
const FileNameVectorType dirs =
h.getDirectoryNames(h.args.base);
for(FileNameVectorType::size_type j = 0; j <
dirs.size(); ++j)
@@ -317,7 +321,8 @@
for(FileNameVectorType::size_type i =
0; i < files.size(); i++)
{
- Hashtable attrs;
+ XMLFileReporter::Hashtable
attrs;
+
const XalanDOMString&
currentFile = files[i];
if
(checkForExclusion(currentFile))
continue;
@@ -341,8 +346,8 @@
const XalanDOMString outbase =
h.args.output + currentDir + FileUtility::s_pathSep + currentFile;
const XalanDOMString
theOutputFile = h.generateFileName(outbase, "out");
- const XSLTInputSource
xslInputSource(c_wstr(theXSLFile));
- const XSLTInputSource
xmlInputSource(c_wstr(theXMLFile));
+ const XSLTInputSource
xslInputSource(theXSLFile);
+ const XSLTInputSource
xmlInputSource(theXMLFile);
const XSLTResultTarget
resultFile(theOutputFile);
// Parsing(compile) the XSL
stylesheet and report the results..
1.8 +31 -9 xml-xalan/c/Tests/Dom2Dom/dom2dom.cpp
Index: dom2dom.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/Dom2Dom/dom2dom.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- dom2dom.cpp 5 Nov 2002 06:08:56 -0000 1.7
+++ dom2dom.cpp 27 Nov 2002 22:36:27 -0000 1.8
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -57,49 +57,68 @@
// Base header file. Must be first.
#include <Include/PlatformDefinitions.hpp>
+
+
#include <iostream>
#include <strstream>
#include <stdio.h>
#include <direct.h>
#include <vector>
+
+
// This is here for memory leak testing.
#if !defined(NDEBUG) && defined(_MSC_VER)
#include <crtdbg.h>
#endif
+
+
#include <xercesc/sax/SAXException.hpp>
#include <xercesc/util/PlatformUtils.hpp>
+
#include <PlatformSupport/DOMStringHelper.hpp>
#include <PlatformSupport/XalanOutputStreamPrintWriter.hpp>
#include <PlatformSupport/XalanFileOutputStream.hpp>
#include <PlatformSupport/XalanStdOutputStream.hpp>
+
+
#include <XMLSupport/FormatterToXML.hpp>
#include <XMLSupport/FormatterTreeWalker.hpp>
+
+
#include <XSLT/XSLTInputSource.hpp>
#include <XSLT/XSLTResultTarget.hpp>
#include <XalanTransformer/XalanTransformer.hpp>
#include <XalanTransformer/XalanCompiledStylesheetDefault.hpp>
+
+
#include <Harness/XMLFileReporter.hpp>
#include <Harness/FileUtility.hpp>
#include <Harness/HarnessInit.hpp>
+
#include <XercesParserLiaison/XercesDOMSupport.hpp>
#include <XercesParserLiaison/XercesParserLiaison.hpp>
-#if !defined(XALAN_NO_NAMESPACES)
- using std::cerr;
- using std::cout;
- using std::endl;
-#endif
+
+XALAN_USING_STD(cerr)
+XALAN_USING_STD(cout)
+XALAN_USING_STD(endl)
+
+
+
+// Just hoist everything...
+XALAN_CPP_NAMESPACE_USE
+
void
@@ -182,7 +201,7 @@
{
unsigned int ii =
lastIndexOf(basedir,charAt(FileUtility::s_pathSep,0));
outdir = substring(basedir, 0, ii+1);
- append(outdir,XalanDOMString("Dom2Dom-RESULTS\\"));
+ append(outdir, "Dom2Dom-RESULTS\\");
f.checkAndCreateDir(outdir);
}
@@ -261,6 +280,7 @@
if (getParams(argc, argv, f, baseDir, outputRoot) == true)
{
+ typedef FileUtility::FileNameVectorType
FileNameVectorType;
// Get the list of Directories that are below perf
const FileNameVectorType dirs =
f.getDirectoryNames(baseDir);
@@ -307,8 +327,8 @@
XalanDocument* domOut =
parserLiaison.createDocument();
const XSLTResultTarget domResultTarget(domOut);
- const XSLTInputSource
xslInputSource(c_wstr(theXSLFile));
- const XSLTInputSource
xmlInputSource(c_wstr(theXMLFile));
+ const XSLTInputSource
xslInputSource(theXSLFile);
+ const XSLTInputSource
xmlInputSource(theXMLFile);
const XalanCompiledStylesheet* compiledSS = 0;
@@ -383,6 +403,8 @@
try
{
+ XALAN_USING_XERCES(XMLPlatformUtils)
+
// Call the static initializers for xerces and xalan, and
create a transformer
//
XMLPlatformUtils::Initialize();
1.12 +44 -22 xml-xalan/c/Tests/Errortests/Errortests.cpp
Index: Errortests.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/Errortests/Errortests.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Errortests.cpp 14 Nov 2002 23:53:39 -0000 1.11
+++ Errortests.cpp 27 Nov 2002 22:36:27 -0000 1.12
@@ -55,6 +55,10 @@
* <http://www.apache.org/>.
*/
+#include <Include/PlatformDefinitions.hpp>
+
+
+
#include <cstdio>
#if defined(XALAN_CLASSIC_IOSTREAMS)
@@ -65,11 +69,10 @@
#include <strstream>
#endif
-#if !defined(XALAN_NO_NAMESPACES)
- using std::cerr;
- using std::cout;
- using std::endl;
-#endif
+
+XALAN_USING_STD(cerr)
+XALAN_USING_STD(cout)
+XALAN_USING_STD(endl)
@@ -99,13 +102,6 @@
-#if defined(XALAN_NO_NAMESPACES)
-typedef map<XalanDOMString, XalanDOMString, less<XalanDOMString> >
Hashtable;
-#else
-typedef std::map<XalanDOMString, XalanDOMString> Hashtable;
-#endif
-
-
// This is here for memory leak testing.
#if !defined(NDEBUG) && defined(_MSC_VER)
#include <crtdbg.h>
@@ -118,6 +114,11 @@
+XALAN_USING_XALAN(FileUtility)
+XALAN_USING_XALAN(XalanDOMString)
+
+
+
void
setHelp(FileUtility& h)
{
@@ -136,11 +137,11 @@
inline bool
-checkForExclusion(XalanDOMString currentFile)
+checkForExclusion(const XalanDOMString& currentFile)
{
for (int i = 0; excludeStylesheets[i] != 0; i++)
- {
- if (equals(currentFile, XalanDOMString(excludeStylesheets[i])))
+ {
+ if (currentFile == XalanDOMString(excludeStylesheets[i]))
{
return true;
}
@@ -156,6 +157,8 @@
int argc,
const char* argv[])
{
+ XALAN_USING_XALAN(HarnessInit)
+
HarnessInit xmlPlatformUtils;
FileUtility h;
@@ -168,6 +171,11 @@
if (h.getParams(argc, argv, "ERR-RESULTS", setGold) == true)
{
+ XALAN_USING_XALAN(XalanTransformer)
+ XALAN_USING_XALAN(XalanSourceTreeDOMSupport)
+ XALAN_USING_XALAN(XalanSourceTreeParserLiaison)
+ XALAN_USING_XALAN(XMLFileReporter)
+
XalanTransformer xalan;
XalanSourceTreeDOMSupport domSupport;
@@ -182,11 +190,14 @@
const XalanDOMString resultFilePrefix("cpperr");
const XalanDOMString resultsFile(h.args.output +
resultFilePrefix + UniqRunid + FileUtility::s_xmlSuffix);
- XMLFileReporter logFile(resultsFile);
+ XMLFileReporter logFile(resultsFile);
logFile.logTestFileInit("Error Testing:");
// Get the list of Directories that are below conf
bool foundDir = false; // Flag indicates directory
found. Used in conjunction with -sub cmd-line arg.
+
+ typedef FileUtility::FileNameVectorType
FileNameVectorType;
+
const FileNameVectorType dirs =
h.getDirectoryNames(h.args.base);
for(FileNameVectorType::size_type j = 0; j < dirs.size();
++j)
@@ -199,7 +210,7 @@
const XalanDOMString& currentDir = dirs[j];
// Run specific category of files from given
directory
- if (length(h.args.sub) == 0 ||
equals(currentDir, h.args.sub) == true)
+ if (h.args.sub.size() == 0 || currentDir ==
h.args.sub)
{
// Check that output directory is there.
const XalanDOMString theOutputDir =
h.args.output + currentDir;
@@ -211,9 +222,16 @@
logFile.logTestCaseInit(currentDir);
const FileNameVectorType files =
h.getTestFileNames(h.args.base, currentDir, false);
+
for(FileNameVectorType::size_type i =
0; i < files.size(); i++)
{
- Hashtable attrs;
+
XALAN_USING_XALAN(XSLTInputSource)
+
XALAN_USING_XALAN(XSLTResultTarget)
+
XALAN_USING_XALAN(XalanCompiledStylesheet)
+
XALAN_USING_XALAN(XalanParsedSource)
+
+ XMLFileReporter::Hashtable
attrs;
+
const XalanDOMString
currentFile(files[i]);
h.data.testOrFile = currentFile;
@@ -228,9 +246,9 @@
const XalanDOMString outbase =
h.args.output + currentDir + FileUtility::s_pathSep + currentFile;
const XalanDOMString
theOutputFile = h.generateFileName(outbase, "out");
- const XSLTInputSource
xslInputSource(c_wstr(theXSLFile));
- const XSLTInputSource
xmlInputSource(c_wstr(theXMLFile));
- const XSLTInputSource
goldInputSource(c_wstr(theGoldFile));
+ const XSLTInputSource
xslInputSource(theXSLFile);
+ const XSLTInputSource
xmlInputSource(theXMLFile);
+ const XSLTInputSource
goldInputSource(theGoldFile);
const XSLTResultTarget
resultFile(theOutputFile);
// Parsing(compile) the XSL
stylesheet and report the results..
@@ -295,7 +313,7 @@
// Check to see if -sub cmd-line directory was processed
correctly.
if (!foundDir)
{
- cout << "Specified test directory: \"" <<
c_str(TranscodeToLocalCodePage(h.args.sub)) << "\" not found" << endl;
+ cout << "Specified test directory: \"" << h.args.sub <<
"\" not found" << endl;
}
h.reportPassFail(logFile, UniqRunid);
@@ -324,6 +342,10 @@
try
{
+ XALAN_USING_XERCES(XMLPlatformUtils)
+
+ XALAN_USING_XALAN(XalanTransformer)
+
// Call the static initializers for xerces and xalan, and
create a transformer
//
XMLPlatformUtils::Initialize();
1.19 +42 -18 xml-xalan/c/Tests/Extensions/extensions.cpp
Index: extensions.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/Extensions/extensions.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- extensions.cpp 30 Aug 2002 23:58:29 -0000 1.18
+++ extensions.cpp 27 Nov 2002 22:36:27 -0000 1.19
@@ -54,13 +54,22 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
+// Base header file. Must be first.
+#include <Include/PlatformDefinitions.hpp>
+
+#include <cstdio>
+
+#if defined(XALAN_CLASSIC_IOSTREAMS)
+#include <iostream.h>
+#include <strstream.h>
+#else
#include <iostream>
#include <strstream>
-#include <cstdio>
-#include <direct.h>
-#include <vector>
+#endif
+
+
// This is here for memory leak testing.
#if !defined(NDEBUG) && defined(_MSC_VER)
@@ -94,11 +103,9 @@
-#if !defined(XALAN_NO_NAMESPACES)
- using std::cerr;
- using std::cout;
- using std::endl;
-#endif
+XALAN_USING_STD(cerr)
+XALAN_USING_STD(cout)
+XALAN_USING_STD(endl)
@@ -106,6 +113,15 @@
const char* const resultString = "The specified function is not
available: http://xml.apache.org/xalan:nodeset";
+XALAN_USING_XALAN(FileUtility)
+XALAN_USING_XALAN(XalanDOMString)
+XALAN_USING_XALAN(XalanTransformer)
+XALAN_USING_XALAN(XMLFileReporter)
+XALAN_USING_XALAN(XSLTInputSource)
+XALAN_USING_XALAN(XSLTResultTarget)
+
+
+
void
setHelp(FileUtility& h)
{
@@ -173,8 +189,8 @@
h.data.xslFileURL = xsl;
// Create the InputSources and ResultTraget.
- const XSLTInputSource xmlInputSource(c_wstr(xml));
- const XSLTInputSource xslInputSource(c_wstr(xsl));
+ const XSLTInputSource xmlInputSource(xml);
+ const XSLTInputSource xslInputSource(xsl);
const XSLTResultTarget theResultTarget(theOutputFile);
// Perform the transform and check the results.
@@ -208,8 +224,8 @@
h.data.xslFileURL = xsl;
// Create the InputSources and ResultTraget.
- const XSLTInputSource xmlInputSource(c_wstr(xml));
- const XSLTInputSource xslInputSource(c_wstr(xsl));
+ const XSLTInputSource xmlInputSource(xml);
+ const XSLTInputSource xslInputSource(xsl);
const XSLTResultTarget theResultTarget(theOutputFile);
// UnInstall the external Global function "nodeset"
@@ -244,7 +260,8 @@
XMLFileReporter& logFile,
FileUtility& h)
{
-
+ XALAN_USING_XALAN(FunctionNodeSet)
+
XalanDOMString xml, xsl, theOutputFile, theGoldFile;
generateFiles(fileName, currentDir, xml, xsl, theOutputFile,
theGoldFile, "tc3-", h);
@@ -254,8 +271,8 @@
h.data.xslFileURL = xsl;
// Create the InputSources and ResultTraget.
- const XSLTInputSource xmlInputSource(c_wstr(xml));
- const XSLTInputSource xslInputSource(c_wstr(xsl));
+ const XSLTInputSource xmlInputSource(xml);
+ const XSLTInputSource xslInputSource(xsl);
const XSLTResultTarget theResultTarget(theOutputFile);
// Install the external function "nodeset"
@@ -315,6 +332,7 @@
XMLFileReporter& logFile,
FileUtility& h)
{
+ XALAN_USING_XALAN(FunctionNodeSet)
XalanDOMString xml, xsl, theOutputFile, theGoldFile;
@@ -324,8 +342,8 @@
h.data.xslFileURL = xsl;
// Create the InputSources and ResultTraget.
- const XSLTInputSource xmlInputSource(c_wstr(xml));
- const XSLTInputSource xslInputSource(c_wstr(xsl));
+ const XSLTInputSource xmlInputSource(xml);
+ const XSLTInputSource xslInputSource(xsl);
const XSLTResultTarget theResultTarget(theOutputFile);
// Install the external function "nodeset" Globally
@@ -355,6 +373,8 @@
{
int theResult = 0;
+ XALAN_USING_XALAN(HarnessInit)
+
HarnessInit xmlPlatformUtils;
FileUtility h;
@@ -371,7 +391,7 @@
// 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;
@@ -402,6 +422,8 @@
h.checkAndCreateDir(theOutputDir);
+ typedef FileUtility::FileNameVectorType
FileNameVectorType;
+
// Get the files found in the "cextension"
directory
const FileNameVectorType files =
h.getTestFileNames(h.args.base, currentDir, true);
@@ -459,6 +481,8 @@
try
{
+ XALAN_USING_XERCES(XMLPlatformUtils)
+
// Call the static initializers for xerces and xalan, and
create a transformer
//
XMLPlatformUtils::Initialize();
1.47 +28 -16 xml-xalan/c/Tests/Harness/FileUtility.cpp
Index: FileUtility.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/Harness/FileUtility.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- FileUtility.cpp 26 Nov 2002 17:32:24 -0000 1.46
+++ FileUtility.cpp 27 Nov 2002 22:36:28 -0000 1.47
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -153,11 +153,9 @@
-#if !defined(XALAN_NO_NAMESPACES)
- using std::cerr;
- using std::cout;
- using std::endl;
-#endif
+XALAN_USING_STD(cerr)
+XALAN_USING_STD(cout)
+XALAN_USING_STD(endl)
@@ -688,10 +686,14 @@
data.pass += 1;
}
else
- { // if the compairson fails gather up the failure data and
determine if it failed
+ {
+ typedef XMLFileReporter::Hashtable Hashtable;
+
+ // if the compairson fails gather up the failure data and
determine if it failed
// due to bad output or missing Gold file. Lastly, log the
failure.
- Hashtable attrs;
- Hashtable actexp;
+ Hashtable attrs;
+ Hashtable actexp;
+
reportError();
attrs.insert(Hashtable::value_type(XalanDOMString("reason"),
XalanDOMString(data.msg)));
@@ -741,7 +743,10 @@
data.fail += 1;
reportError();
- Hashtable actexp;
+
+ typedef XMLFileReporter::Hashtable Hashtable;
+
+ Hashtable actexp;
actexp.insert(Hashtable::value_type(XalanDOMString("exp"),
expected));
actexp.insert(Hashtable::value_type(XalanDOMString("act"),
actual));
@@ -811,10 +816,14 @@
data.pass += 1;
}
else
- { // if the compairson fails gather up the failure data and
determine if it failed
+ {
+ typedef XMLFileReporter::Hashtable Hashtable;
+
+ // if the compairson fails gather up the failure data and
determine if it failed
// due to bad output or missing Gold file. Lastly, log the
failure.
Hashtable attrs;
Hashtable actexp;
+
reportError();
attrs.insert(Hashtable::value_type(XalanDOMString("reason"),
XalanDOMString(data.msg)));
@@ -851,8 +860,8 @@
const XalanDOMString& goldFile)
{
- const XSLTInputSource resultInputSource(c_wstr(outputFile));
- const XSLTInputSource goldInputSource(c_wstr(goldFile));
+ const XSLTInputSource resultInputSource(outputFile);
+ const XSLTInputSource goldInputSource(goldFile);
XalanSourceTreeDOMSupport domSupport;
XalanSourceTreeParserLiaison parserLiaison(domSupport);
@@ -1462,7 +1471,10 @@
XMLFileReporter& logfile,
const XalanDOMString& runid)
{
- Hashtable runResults;
+ typedef XMLFileReporter::Hashtable Hashtable;
+
+ Hashtable runResults;
+
char temp[5];
// Create entrys that contain runid, xerces version, and numbers for
Pass, Fail and No Gold.
@@ -1535,8 +1547,8 @@
}
// Create the InputSources and ResultTarget.
- const XSLTInputSource xslInputSource(c_wstr(theStylesheet));
- const XSLTInputSource xmlInputSource(c_wstr(theXMLSource));
+ const XSLTInputSource xslInputSource(theStylesheet);
+ const XSLTInputSource xmlInputSource(theXMLSource);
const XSLTResultTarget resultFile(theHTMLFile);
// Do the transform, display the output HTML, or report any failure.
1.32 +7 -9 xml-xalan/c/Tests/Harness/FileUtility.hpp
Index: FileUtility.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/Harness/FileUtility.hpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- FileUtility.hpp 26 Nov 2002 17:32:24 -0000 1.31
+++ FileUtility.hpp 27 Nov 2002 22:36:28 -0000 1.32
@@ -148,13 +148,15 @@
{
private:
-#if defined(XALAN_NO_NAMESPACES)
- ostrstream help;
+#if defined(XALAN_NO_STD_NAMESPACE)
+ typedef ostrstream StreamType;
#else
- std::ostrstream help;
+ typedef std::ostrstream StreamType;
#endif
- char* data;
+ StreamType help;
+
+ char* data;
public:
@@ -186,11 +188,7 @@
return data;
}
-#if defined(XALAN_NO_NAMESPACES)
- ostream&
-#else
- std::ostream&
-#endif
+ StreamType&
getHelpStream()
{
return help;
1.4 +0 -8 xml-xalan/c/Tests/Harness/HarnessInit.cpp
Index: HarnessInit.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/Harness/HarnessInit.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- HarnessInit.cpp 26 Nov 2002 02:12:27 -0000 1.3
+++ HarnessInit.cpp 27 Nov 2002 22:36:28 -0000 1.4
@@ -61,10 +61,6 @@
-#include <xercesc/util/PlatformUtils.hpp>
-
-
-
#include <XalanDOM/XalanDOMInit.hpp>
@@ -85,8 +81,6 @@
{
assert(s_xalanDOMInit == 0);
- XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::Initialize();
-
s_xalanDOMInit = new XalanDOMInit;
FileUtility::initialize();
@@ -101,8 +95,6 @@
delete s_xalanDOMInit;
s_xalanDOMInit = 0;
-
- XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::Terminate();
}
1.15 +5 -6 xml-xalan/c/Tests/Harness/XMLFileReporter.hpp
Index: XMLFileReporter.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/Harness/XMLFileReporter.hpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- XMLFileReporter.hpp 26 Nov 2002 02:12:27 -0000 1.14
+++ XMLFileReporter.hpp 27 Nov 2002 22:36:28 -0000 1.15
@@ -78,17 +78,16 @@
+// This class is exported from the Harness.dll
+class HARNESS_API XMLFileReporter
+{
+public:
+
#if defined(XALAN_NO_STD_NAMESPACE)
typedef map<XalanDOMString, XalanDOMString, less<XalanDOMString> >
Hashtable;
#else
typedef std::map<XalanDOMString, XalanDOMString> Hashtable;
#endif
-
-
-// This class is exported from the Harness.dll
-class HARNESS_API XMLFileReporter
-{
-
public:
1.20 +34 -23 xml-xalan/c/Tests/InputSource/inputsource.cpp
Index: inputsource.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/InputSource/inputsource.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- inputsource.cpp 3 Nov 2002 03:42:30 -0000 1.19
+++ inputsource.cpp 27 Nov 2002 22:36:28 -0000 1.20
@@ -59,11 +59,15 @@
-#include <iostream>
-#include <strstream>
#include <cstdio>
-#include <direct.h>
-#include <vector>
+
+#if defined(XALAN_CLASSIC_IOSTREAMS)
+#include <iostream.h>
+#else
+#include <iostream>
+#endif
+
+
// This is here for memory leak testing.
#if !defined(NDEBUG) && defined(_MSC_VER)
@@ -77,11 +81,7 @@
-#if XERCES_VERSION_MAJOR >= 2
-#include <xercesc/dom/deprecated/DOMParser.hpp>
-#else
-#include <xercesc/parsers/DOMParser.hpp>
-#endif
+#include <xercesc/parsers/XercesDOMParser.hpp>
@@ -103,20 +103,24 @@
#include <XalanTransformer/XalanTransformer.hpp>
#include <XalanTransformer/XercesDOMWrapperParsedSource.hpp>
+
// HARNESS HEADERS...
#include <Harness/XMLFileReporter.hpp>
#include <Harness/FileUtility.hpp>
#include <Harness/HarnessInit.hpp>
-#if !defined(XALAN_NO_NAMESPACES)
- using std::cerr;
- using std::cout;
- using std::endl;
-#endif
+XALAN_USING_STD(cerr)
+XALAN_USING_STD(cout)
+XALAN_USING_STD(endl)
+// Just hoist everything...
+XALAN_CPP_NAMESPACE_USE
+
+
+
void
setHelp(FileUtility& h)
{
@@ -152,8 +156,8 @@
h.data.testOrFile = "InputSource-TestCase1";
// This code exercised the stated methods of XSLTInputSource
- const XSLTInputSource xmlInputSource(c_wstr(xml));
- const XSLTInputSource xslInputSource(c_wstr(xsl), c_wstr(publicID));
+ const XSLTInputSource xmlInputSource(xml);
+ const XSLTInputSource xslInputSource(xsl, publicID);
// Do the transform and report the results.
xalan.transform(xmlInputSource, xslInputSource, theResultTarget);
@@ -329,13 +333,16 @@
const XalanDOMString& theGoldFile,
FileUtility& h)
{
+ XALAN_USING_XERCES(XercesDOMParser)
+ XALAN_USING_XERCES(DOMDocument)
+
h.data.testOrFile = "InputSource-TestCase5";
- const XSLTInputSource xmlInputSource(c_wstr(xml));
+ const XSLTInputSource xmlInputSource(xml);
- DOMParser theParser;
- theParser.setToCreateXMLDeclTypeNode(false);
+ XercesDOMParser theParser;
+
theParser.parse(xmlInputSource);
- const DOM_Document theDOM = theParser.getDocument();
+ const DOMDocument* const theDOM = theParser.getDocument();
XercesDOMSupport theDOMSupport;
XercesParserLiaison theParserLiaison(theDOMSupport);
@@ -348,7 +355,7 @@
const XalanDOMString theOutputFile(outBase +
XalanDOMString("\\InputSource-TestCase5.out"));
- const XSLTInputSource xslInputSource(c_wstr(xsl));
+ const XSLTInputSource xslInputSource(xsl);
const XSLTResultTarget theResultTarget(theOutputFile);
// Do the transform and report the results.
@@ -382,7 +389,7 @@
const XalanDOMString drive(h.getDrive());
const XalanDOMString resultFilePrefix("isource");
const XalanDOMString resultsFile(drive + h.args.output +
resultFilePrefix + UniqRunid + FileUtility::s_xmlSuffix);
-
+
XMLFileReporter logFile(resultsFile);
logFile.logTestFileInit("XSLTInputSource Testing: Give various
types of allowable Inputs. ");
@@ -391,7 +398,7 @@
XalanTransformer xalan;
XalanDOMString fileName;
-
+
// Get testfiles from the capi\smoke directory, create
output directory, .
//
const XalanDOMString currentDir("smoke");
@@ -399,6 +406,8 @@
h.checkAndCreateDir(theOutputDir);
+ typedef FileUtility::FileNameVectorType
FileNameVectorType;
+
// Get the single file found in the "smoke" directory,
and run tests.
//
const FileNameVectorType files =
h.getTestFileNames(h.args.base, currentDir, true);
@@ -464,6 +473,8 @@
try
{
+ XALAN_USING_XERCES(XMLPlatformUtils)
+
// Call the static initializers for xerces and xalan, and
create a transformer
//
XMLPlatformUtils::Initialize();
1.22 +42 -16 xml-xalan/c/Tests/Memory/Stressmem.cpp
Index: Stressmem.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/Memory/Stressmem.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- Stressmem.cpp 30 Aug 2002 23:58:29 -0000 1.21
+++ Stressmem.cpp 27 Nov 2002 22:36:28 -0000 1.22
@@ -54,18 +54,25 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
+#include <Include/PlatformDefinitions.hpp>
+
+
+
+#include <cstdio>
+
+#if defined(XALAN_CLASSIC_IOSTREAMS)
+#include <iostream.h>
+#else
#include <iostream>
-#include <strstream>
-#include <stdio.h>
-//#include <direct.h>
+#endif
+
+
// This is here for memory leak testing.
#if !defined(NDEBUG) && defined(_MSC_VER)
#include <crtdbg.h>
#endif
-#include <vector>
-
#include <xercesc/util/PlatformUtils.hpp>
@@ -80,28 +87,30 @@
-#if !defined(XALAN_NO_NAMESPACES)
- using std::cerr;
- using std::cout;
- using std::endl;
-#endif
+XALAN_USING_STD(cerr)
+XALAN_USING_STD(cout)
+XALAN_USING_STD(endl)
static const char* const excludeStylesheets[] =
{
-// "impincl16.xml",
0
};
+XALAN_USING_XALAN(FileUtility)
+XALAN_USING_XALAN(XalanDOMString)
+
+
+
inline bool
checkForExclusion(const XalanDOMString& currentFile)
{
for (int i = 0; excludeStylesheets[i] != 0; ++i)
{
- if (equals(currentFile, XalanDOMString(excludeStylesheets[i])))
+ if (currentFile == XalanDOMString(excludeStylesheets[i]))
{
return true;
}
@@ -138,6 +147,8 @@
try
{
+ XALAN_USING_XALAN(HarnessInit)
+
HarnessInit xmlPlatformUtils;
FileUtility h;
@@ -150,6 +161,12 @@
//
if (h.getParams(argc, argv, "MEM-RESULTS", setGold) == true)
{
+ //XALAN_USING_XALAN(XalanSourceTreeDOMSupport)
+ //XALAN_USING_XALAN(XalanSourceTreeParserLiaison)
+ XALAN_USING_XALAN(XMLFileReporter)
+
+ typedef FileUtility::FileNameVectorType
FileNameVectorType;
+
// Get the list of Directories that are below perf
const FileNameVectorType dirs =
h.getDirectoryNames(h.args.base);
@@ -167,6 +184,8 @@
try
{
+ XALAN_USING_XALAN(XalanTransformer)
+
bool foundDir = false;
XalanTransformer transformEngine;
@@ -175,7 +194,7 @@
{
// Skip all but the specified directory
if the -sub cmd-line option was used.
//
- if (length(h.args.sub) > 0 &&
!equals(dirs[j], h.args.sub))
+ if (h.args.sub.length() > 0 && dirs[j]
!= h.args.sub)
{
continue;
}
@@ -191,6 +210,9 @@
{
if (checkForExclusion(files[i])
== false)
{
+
XALAN_USING_XALAN(XSLTInputSource)
+
XALAN_USING_XALAN(XSLTResultTarget)
+
// Output file name to
result log and console.
logFile.logTestCaseInit(files[i]);
cout << files[i] <<
endl;
@@ -203,8 +225,8 @@
// Do a total end to
end transform with no pre parsing of either xsl or xml files.
const XSLTResultTarget
theResultTarget(theOutputFile);
- const XSLTInputSource
xslInputSource(c_wstr(theXSLFile));
- const XSLTInputSource
xmlInputSource(c_wstr(theXMLFile));
+ const XSLTInputSource
xslInputSource(theXSLFile);
+ const XSLTInputSource
xmlInputSource(theXMLFile);
const int
theResult =
transformEngine.transform(xmlInputSource, xslInputSource, theResultTarget);
@@ -225,7 +247,7 @@
// Check to see if -sub cmd-line directory was
processed correctly.
if (!foundDir)
{
- cout << "Specified test directory: \""
<< c_str(TranscodeToLocalCodePage(h.args.sub)) << "\" not found" << endl;
+ cout << "Specified test directory: \""
<< h.args.sub << "\" not found" << endl;
}
logFile.logTestFileClose("Memory Testing: ",
"Done");
@@ -266,6 +288,10 @@
try
{
+ XALAN_USING_XERCES(XMLPlatformUtils)
+
+ XALAN_USING_XALAN(XalanTransformer)
+
// Call the static initializers for xerces and xalan, and
create a transformer
//
XMLPlatformUtils::Initialize();
1.21 +25 -14 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.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- Params.cpp 30 Aug 2002 23:58:29 -0000 1.20
+++ Params.cpp 27 Nov 2002 22:36:28 -0000 1.21
@@ -57,34 +57,45 @@
// Base header file. Must be first.
#include <Include/PlatformDefinitions.hpp>
+
+
+#include <cstdio>
+
+#if defined(XALAN_CLASSIC_IOSTREAMS)
+#include <iostream.h>
+#else
#include <iostream>
-#include <strstream>
-#include <stdio.h>
-#include <direct.h>
-#include <vector>
+#endif
// This is here for memory leak testing.
#if !defined(NDEBUG) && defined(_MSC_VER)
#include <crtdbg.h>
#endif
+
+
#include <xercesc/util/PlatformUtils.hpp>
+
+
#include <XSLT/XSLTInputSource.hpp>
#include <XSLT/XSLTResultTarget.hpp>
+
+
#include <XalanTransformer/XalanTransformer.hpp>
+
+
#include <Harness/XMLFileReporter.hpp>
#include <Harness/FileUtility.hpp>
#include <Harness/HarnessInit.hpp>
-#if !defined(XALAN_NO_NAMESPACES)
- using std::cerr;
- using std::cout;
- using std::endl;
-#endif
+
+XALAN_USING_STD(cerr)
+XALAN_USING_STD(cout)
+XALAN_USING_STD(endl)
@@ -205,9 +216,9 @@
theGoldFile = h.args.gold + currentDir
+ FileUtility::s_pathSep + fileName;
theGoldFile =
h.generateFileName(theGoldFile, "out");
- XSLTResultTarget
theResultTarget(theOutputFile);
- const XSLTInputSource
xslInputSource(c_wstr(theXSLFile));
- const XSLTInputSource
xmlInputSource(c_wstr(theXMLFile));
+ const XSLTResultTarget
theResultTarget(theOutputFile);
+ const XSLTInputSource
xslInputSource(theXSLFile);
+ const XSLTInputSource
xmlInputSource(theXMLFile);
// Set the desired parameters
switch (getTestNumber(fileName))
@@ -236,7 +247,7 @@
case 7:
{
- const
XSLTInputSource embed07InputSource(c_wstr(theXSLFile));
+ const
XSLTInputSource embed07InputSource(theXSLFile);
xalan.transform(embed07InputSource, theResultTarget);
append(h.data.testOrFile, " (Embed01)" );
embedFlag =
true;
@@ -245,7 +256,7 @@
case 8:
{
- const
XSLTInputSource embed08InputSource(c_wstr(theXSLFile));
+ const
XSLTInputSource embed08InputSource(theXSLFile);
xalan.transform(embed08InputSource, theResultTarget);
append(h.data.testOrFile, " (Embed02)" );
embedFlag =
true;
1.17 +2 -2 xml-xalan/c/Tests/PerfT/perft.cpp
Index: perft.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/PerfT/perft.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- perft.cpp 30 Aug 2002 23:58:29 -0000 1.16
+++ perft.cpp 27 Nov 2002 22:36:29 -0000 1.17
@@ -236,8 +236,8 @@
const XalanDOMString outbase = h.args.output
+ dirs[j] + FileUtility::s_pathSep + files[i];
const XalanDOMString theOutputFile =
h.generateFileName(outbase, "out");
- const XSLTInputSource
xslInputSource(c_wstr(theXSLFile));
- const XSLTInputSource
xmlInputSource(c_wstr(theXMLFile));
+ const XSLTInputSource
xslInputSource(theXSLFile);
+ const XSLTInputSource
xmlInputSource(theXMLFile);
const XSLTResultTarget
theResultTarget(theOutputFile);
attrs.insert(Hashtable::value_type(XalanDOMString("href"), theXSLFile));
1.33 +42 -51 xml-xalan/c/Tests/Performance/perf.cpp
Index: perf.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/Performance/perf.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- perf.cpp 21 Sep 2002 01:26:05 -0000 1.32
+++ perf.cpp 27 Nov 2002 22:36:29 -0000 1.33
@@ -55,18 +55,19 @@
* <http://www.apache.org/>.
*/
-#include <iostream>
-#include <strstream>
-#include <stdio.h>
-#include <direct.h>
+#include <cstdio>
+#if defined(XALAN_CLASSIC_IOSTREAMS)
+#include <iostream.h>
+#else
+#include <iostream>
+#endif
// This is here for memory leak testing.
#if !defined(NDEBUG) && defined(_MSC_VER)
#include <crtdbg.h>
#endif
-#include <vector>
#include <xercesc/util/PlatformUtils.hpp>
@@ -94,49 +95,44 @@
#include <Harness/HarnessInit.hpp>
-#if !defined(XALAN_NO_NAMESPACES)
- using std::cerr;
- using std::cout;
- using std::endl;
-#endif
-
-#if defined(XALAN_NO_NAMESPACES)
- typedef map<XalanDOMString, XalanDOMString, less<XalanDOMString> >
Hashtable;
-#else
- typedef std::map<XalanDOMString, XalanDOMString> Hashtable;
-#endif
+XALAN_USING_STD(cerr)
+XALAN_USING_STD(cout)
+XALAN_USING_STD(endl)
- const char* const excludeStylesheets[] =
+const char* const excludeStylesheets[] =
{
"large-evans_large.xsl",
0
};
+
inline bool
checkForExclusion(const XalanDOMString& currentFile)
{
+ for (int i=0; excludeStylesheets[i] != 0; i++)
+ {
+ if (equals(currentFile, XalanDOMString(excludeStylesheets[i])))
+ {
+ return true;
+ }
+ }
- for (int i=0; excludeStylesheets[i] != 0; i++)
- {
- if (equals(currentFile,
XalanDOMString(excludeStylesheets[i])))
- {
- return true;
- }
- }
- return false;
+ return false;
}
+
+
inline StylesheetRoot*
processStylesheet(
const XalanDOMString& theFileName,
XSLTProcessor&
theProcessor,
StylesheetConstructionContext& theConstructionContext)
{
- const XSLTInputSource theInputSource(c_wstr(theFileName));
+ const XSLTInputSource theInputSource(theFileName);
return theProcessor.processStylesheet(theInputSource,
theConstructionContext);
}
@@ -148,7 +144,7 @@
const XalanDOMString& theFileName,
XSLTProcessor& theProcessor)
{
- const XSLTInputSource theInputSource(c_wstr(theFileName));
+ const XSLTInputSource theInputSource(theFileName);
return theProcessor.getSourceTreeFromInput(theInputSource);
}
@@ -301,11 +297,12 @@
{
// Generate Unique Run id and processor info
- const XalanDOMString UniqRunid = h.generateUniqRunid();
- const XalanDOMString resultFilePrefix(XalanDOMString("cpp"));
- const XalanDOMString resultsFile(h.args.output +
resultFilePrefix + UniqRunid + FileUtility::s_xmlSuffix);
+ const XalanDOMString UniqRunid = h.generateUniqRunid();
+ const XalanDOMString resultFilePrefix(XalanDOMString("cpp"));
+ const XalanDOMString resultsFile(h.args.output +
resultFilePrefix + UniqRunid + FileUtility::s_xmlSuffix);
XMLFileReporter logFile(resultsFile);
+
logFile.logTestFileInit("Performance Testing - Reports
performance times for single transform, and average for multiple transforms
using compiled stylesheet");
try
@@ -348,10 +345,9 @@
double timeinMilliseconds,
theAverage;
Hashtable attrs;
- if (skip)
+ if (skip &&
checkForExclusion(files[i]))
{
- if
(checkForExclusion(files[i]))
- continue;
+ continue;
}
const XalanDOMString
theXSLFile= h.args.base + dirs[j] + FileUtility::s_pathSep + files[i];
@@ -436,9 +432,9 @@
// the processor, since those
objects have the same lifetime as
// other objects created as a
result of the execution.
- XSLTResultTarget
theResultTarget(theOutputFile);
- const XSLTInputSource
xslInputSource(c_wstr(theXSLFile));
- const XSLTInputSource
xmlInputSource(c_wstr(theXMLFile));
+ const XSLTResultTarget
theResultTarget(theOutputFile);
+ const XSLTInputSource
xslInputSource(theXSLFile);
+ const XSLTInputSource
xmlInputSource(theXMLFile);
StylesheetExecutionContextDefault psExecutionContext(
csProcessor,
@@ -548,30 +544,25 @@
}
- // Check to see if -sub cmd-line directory was processed
correctly.
- if (!foundDir)
- {
- cout << "Specified test directory: \"" <<
c_str(TranscodeToLocalCodePage(h.args.sub)) << "\" not found" << endl;
- }
-
- h.reportPassFail(logFile, UniqRunid);
- logFile.logTestFileClose("Performance", "Done");
- logFile.close();
-
- }//try
+ // Check to see if -sub cmd-line directory was
processed correctly.
+ if (!foundDir)
+ {
+ cout << "Specified test directory: \"" <<
c_str(TranscodeToLocalCodePage(h.args.sub)) << "\" not found" << endl;
+ }
+ h.reportPassFail(logFile, UniqRunid);
+ logFile.logTestFileClose("Performance", "Done");
+ logFile.close();
+ }
catch(const
XalanFileOutputStream::XalanFileOutputStreamOpenException& ex)
{
cerr << ex.getMessage() << endl << endl;
}
-
catch(...)
{
cerr << "Exception caught!!!" << endl << endl;
}
-
-
- } //if getParams
+ }
return 0;
}
1.27 +38 -13 xml-xalan/c/Tests/Threads/ThreadTest.cpp
Index: ThreadTest.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/Threads/ThreadTest.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- ThreadTest.cpp 14 Nov 2002 23:53:39 -0000 1.26
+++ ThreadTest.cpp 27 Nov 2002 22:36:29 -0000 1.27
@@ -54,26 +54,32 @@
-#if !defined(XALAN_NO_NAMESPACES)
- using std::cerr;
- using std::cout;
- using std::endl;
+XALAN_USING_STD(cerr)
+XALAN_USING_STD(cout)
+XALAN_USING_STD(endl)
+
+
+
#if defined(XALAN_STRICT_ANSI_HEADERS)
using std::atoi;
using std::signal;
using std::strcmp;
#endif
-#endif
-
-// This is here for memory leak testing.
+
+ // This is here for memory leak testing.
#if defined(_DEBUG)
#include <crtdbg.h>
#endif
+typedef XERCES_CPP_NAMESPACE_QUALIFIER XMLMutex
XMLMutexType;
+typedef XERCES_CPP_NAMESPACE_QUALIFIER XMLMutexLock
XMLMutexLockType;
+
+
+
class SynchronizedCounter
{
public:
@@ -93,9 +99,9 @@
private:
- mutable XMLMutex m_mutex;
+ mutable XMLMutexType m_mutex;
- long m_counter;
+ long m_counter;
};
@@ -117,7 +123,7 @@
void
SynchronizedCounter::increment()
{
- XMLMutexLock theLock(&m_mutex);
+ XMLMutexLockType theLock(&m_mutex);
if (m_counter < LONG_MAX)
{
@@ -130,7 +136,7 @@
void
SynchronizedCounter::decrement()
{
- XMLMutexLock theLock(&m_mutex);
+ XMLMutexLockType theLock(&m_mutex);
if (m_counter > 0)
{
@@ -169,6 +175,13 @@
+XALAN_USING_XALAN(XalanCompiledStylesheet)
+XALAN_USING_XALAN(XalanDOMChar)
+XALAN_USING_XALAN(XalanDOMString)
+XALAN_USING_XALAN(XalanParsedSource)
+
+
+
// Used to hold compiled stylesheet and pre-parsed source...
const XalanCompiledStylesheet* glbCompiledStylesheet = 0;
const XalanParsedSource* glbParsedSource = 0;
@@ -250,6 +263,9 @@
try
{
+ XALAN_USING_XALAN(UnsignedLongToDOMString)
+ XALAN_USING_XALAN(XalanTransformer)
+
// Our input file. The assumption is that the executable will
be run
// from same directory as the input files.
@@ -263,7 +279,7 @@
XalanTransformer theTransformer;
// Do the transform...
- theTransformer.transform(*glbParsedSource,
glbCompiledStylesheet, XSLTResultTarget(theOutputFile));
+ theTransformer.transform(*glbParsedSource,
glbCompiledStylesheet, theOutputFile);
}
catch(...)
{
@@ -311,6 +327,9 @@
try
{
+ XALAN_USING_XALAN(UnsignedLongToDOMString)
+ XALAN_USING_XALAN(XalanTransformer)
+
// Our input file. The assumption is that the executable will
be run
// from same directory as the input files.
@@ -329,7 +348,7 @@
theTransformer.transform(
theSourceFileName,
theStylesheetFileName,
- XSLTResultTarget(theOutputFile));
+ theOutputFile);
}
catch(...)
{
@@ -531,6 +550,8 @@
cout << endl << "Starting " << theThreadCount << " threads." << endl;
+ XALAN_USING_XALAN(XalanArrayAutoPtr)
+
XalanArrayAutoPtr<ThreadInfo> theThreadInfo(new
ThreadInfo[theThreadCount]);
try
@@ -655,6 +676,10 @@
{
try
{
+ XALAN_USING_XERCES(XMLPlatformUtils)
+
+ XALAN_USING_XALAN(XalanTransformer)
+
// Initialize Xerces...
XMLPlatformUtils::Initialize();
1.9 +33 -21 xml-xalan/c/Tests/Transformer/TestXalanTransformer.cpp
Index: TestXalanTransformer.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/Transformer/TestXalanTransformer.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- TestXalanTransformer.cpp 14 Nov 2002 23:53:39 -0000 1.8
+++ TestXalanTransformer.cpp 27 Nov 2002 22:36:29 -0000 1.9
@@ -55,6 +55,9 @@
* <http://www.apache.org/>.
*/
+#include <Include/PlatformDefinitions.hpp>
+
+
#define TEST_XALAN_CPP
@@ -82,12 +85,10 @@
#endif
-#if !defined(XALAN_NO_NAMESPACES)
- using std::cerr;
- using std::cout;
- using std::endl;
- using std::ostrstream;
-#endif
+XALAN_USING_STD(cerr)
+XALAN_USING_STD(cout)
+XALAN_USING_STD(endl)
+XALAN_USING_STD(ostrstream)
#else
@@ -98,21 +99,16 @@
#endif
-static unsigned long xalan_output_handler(const void *data, unsigned long
length, const void *handle)
+static CallbackSizeType xalan_output_handler(const char *data,
CallbackSizeType length, void *handle)
{
FILE *fp = (FILE*)handle;
- char* d = (char *)data;
-
-
- fwrite( d, sizeof( char ), length, stdout );
-
- return fwrite( d, sizeof( char ), length, fp );
+ return fwrite( data, sizeof( char ), length, fp );
}
-static void xalan_flush_handler(const void *handle)
+static void xalan_flush_handler(void *handle)
{
FILE *fp = (FILE*)handle;
@@ -141,7 +137,10 @@
#if defined(TEST_XALAN_CPP)
- XalanTransformer xalan;
+ XALAN_USING_XALAN(XalanTransformer)
+ XALAN_USING_XALAN(XalanCompiledStylesheet)
+
+ XalanTransformer xalan;
const XalanCompiledStylesheet* css = 0;
@@ -207,8 +206,8 @@
return 0;
}
*/
- xalan.setStylesheetParam(XalanDOMString("param1"),
-
XalanDOMString("'What is Up'"));
+ xalan.setStylesheetParam("param1",
+ "'What is
Up'");
if(xalan.transform(theXMLFileName4, theXSLFileName4, &cout))
{
@@ -233,6 +232,7 @@
XalanHandle xalan = CreateXalanTransformer();
XalanCSSHandle theXalanCSS2;
XalanCSSHandle theXalanCSS4;
+ XalanPSHandle theXalanPS2;
if (XalanCompileStylesheet(theXSLFileName2, xalan, &theXalanCSS2) != 0)
{
@@ -242,7 +242,15 @@
return 0;
}
- XalanCompileStylesheet(theXSLFileName4, xalan, &theXalanCSS4) != 0)
+ if (XalanCompileStylesheet(theXSLFileName4, xalan, &theXalanCSS4) != 0)
+ {
+ puts("Error");
+ puts(XalanGetLastError(xalan));
+
+ return 0;
+ }
+
+ if (XalanParseSource(theXMLFileName2, xalan, &theXalanPS2) != 0)
{
puts("Error");
puts(XalanGetLastError(xalan));
@@ -290,7 +298,7 @@
XalanFreeData(theOutput);
- if(XalanTransformToDataCSS(theXMLFileName2, theXalanCSS2,
&theOutput, xalan))
+ if(XalanTransformToDataPrebuilt(theXalanPS2, theXalanCSS2,
&theOutput, xalan))
{
puts("Error");
puts(XalanGetLastError(xalan));
@@ -304,7 +312,7 @@
FILE* fp =0;
fp = fopen("c:\\temp\\test.out", "w");
- if(XalanTransformToHandlerCSS(theXMLFileName2, theXalanCSS2,
xalan, fp, xalan_output_handler, xalan_flush_handler))
+ if(XalanTransformToHandler(theXMLFileName2, theXSLFileName2,
xalan, fp, xalan_output_handler, xalan_flush_handler))
{
puts("Error");
puts(XalanGetLastError(xalan));
@@ -316,7 +324,7 @@
XalanSetStylesheetParam("param1", "'hi'", xalan);
//if(xalan.transform(theXMLFileName4, theXSLFileName4, &cout))
- if(XalanTransformToDataCSS(theXMLFileName4, theXalanCSS4,
&theOutput, xalan))
+ if(XalanTransformToDataPrebuilt(theXMLFileName4, theXalanCSS4,
&theOutput, xalan))
{
puts("Error");
puts(XalanGetLastError(xalan));
@@ -355,6 +363,10 @@
#if defined(TEST_XALAN_CPP)
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]