You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2002/01/22 19:48:00 UTC
cvs commit: xml-xalan/c/Tests/Harness HarnessDefinitions.hpp HarnessInit.cpp FileUtility.cpp FileUtility.hpp Harness.dsp HarnessInit.hpp XMLFileReporter.cpp XMLFileReporter.hpp
dbertoni 02/01/22 10:48:00
Modified: c/Tests/Harness FileUtility.cpp FileUtility.hpp Harness.dsp
HarnessInit.hpp XMLFileReporter.cpp
XMLFileReporter.hpp
Added: c/Tests/Harness HarnessDefinitions.hpp HarnessInit.cpp
Log:
Removed static strings, etc. Major clean-up.
Revision Changes Path
1.33 +188 -29 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.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- FileUtility.cpp 14 Dec 2001 20:11:53 -0000 1.32
+++ FileUtility.cpp 22 Jan 2002 18:47:59 -0000 1.33
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -55,6 +55,10 @@
* <http://www.apache.org/>.
*/
+#include "FileUtility.hpp"
+
+
+
#include <cstdlib>
#include <cstdio>
#include <ctime>
@@ -62,8 +66,6 @@
#include <climits>
#include <cstring>
-// Added for directory creation
-#include <strstream>
#if defined(WIN32)
#include <direct.h>
#define PATH_MAX _MAX_PATH
@@ -80,26 +82,57 @@
#if defined(XALAN_OLD_STREAM_HEADERS)
#include <iostream.h>
+#include <strstrea.h>
#else
#include <iostream>
+#include <strstream>
#endif
#if !defined(NDEBUG) && defined(_MSC_VER)
#include <crtdbg.h>
#endif
-// XERCES HEADERS...
-// Are included by HarnessInit.hpp
-#include "HarnessInit.hpp"
+
+
#include <sax/SAXException.hpp>
-// XALAN HEADERS...
-// Are included by FileUtility.hpp
-#include "FileUtility.hpp"
+
+
+#include <PlatformSupport/DirectoryEnumerator.hpp>
+#include <PlatformSupport/DOMStringHelper.hpp>
+#include <PlatformSupport/XalanOutputStreamPrintWriter.hpp>
+#include <PlatformSupport/XalanFileOutputStream.hpp>
+
+
+
+#include <XMLSupport/FormatterToXML.hpp>
+#include <XMLSupport/FormatterTreeWalker.hpp>
+
+
+
+#include <XalanSourceTree/XalanSourceTreeDOMSupport.hpp>
+#include <XalanSourceTree/XalanSourceTreeParserLiaison.hpp>
+#include <XalanSourceTree/XalanSourceTreeDocument.hpp>
+
+
+
+#include <XSLT/StylesheetRoot.hpp>
+
+
+
+#include <XalanTransformer/XalanCompiledStylesheet.hpp>
+#include <XalanTransformer/XalanTransformer.hpp>
+
+
+
#include "XMLFileReporter.hpp"
-char *xalanNodeTypes[]=
- {"UNKNOWN_NODE",
+
+
+
+const char* const xalanNodeTypes[] =
+{
+ "UNKNOWN_NODE",
"ELEMENT_NODE",
"ATTRIBUTE_NODE",
"TEXT_NODE",
@@ -111,7 +144,70 @@
"DOCUMENT_NODE",
"DOCUMENT_TYPE_NODE",
"DOCUMENT_FRAGMENT_NODE",
- "NOTATION_NODE"};
+ "NOTATION_NODE"
+};
+
+
+
+#if !defined(XALAN_NO_NAMESPACES)
+ using std::cout;
+ using std::endl;
+#endif
+
+
+
+FileUtility::reportStruct::reportStruct() :
+ theDrive(),
+ testOrFile(),
+ xmlFileURL(),
+ xslFileURL(),
+ xmlFormat(),
+ msg(0),
+ currentNode(),
+ actual(),
+ expected(),
+ pass(0),
+ fail(0),
+ nogold(0)
+{
+}
+
+
+
+void
+FileUtility::reportStruct::reset()
+{
+ clear(testOrFile);
+ msg = "";
+ clear(currentNode);
+ clear(actual);
+ clear(expected);
+}
+
+
+
+FileUtility::cmdParams::cmdParams() :
+ help(),
+ data(0),
+ base(),
+ output(),
+ gold(),
+ sub(),
+ source(0),
+ skip(false),
+ iters(0)
+{
+}
+
+
+
+FileUtility::FileUtility() :
+ data(),
+ args()
+{
+ cout << endl << "Using Xerces Version " << gXercesFullVersionStr << endl;
+}
+
#if !defined(WIN32)
@@ -155,7 +251,7 @@
//
if (argc == 1 || argv[1][0] == '-')
{
- cout << args.help.str();
+ cout << args.getHelpMessage();
return false;
}
else
@@ -167,7 +263,7 @@
else
{
cout << endl << "Given base directory \"" << argv[1] << "\" does not exist" << endl;
- cout << args.help.str();
+ cout << args.getHelpMessage();
return false;
}
}
@@ -182,13 +278,13 @@
if(i < argc && argv[i][0] != '-')
{
assign(args.output, XalanDOMString(argv[i]));
- append(args.output, pathSep);
+ append(args.output, s_pathSep);
checkAndCreateDir(args.output);
fsetOut = false;
}
else
{
- cout << args.help.str();
+ cout << args.getHelpMessage();
fSuccess = false;
}
}
@@ -205,12 +301,12 @@
fSuccess = false;
}
- append(args.gold, pathSep);
+ append(args.gold, s_pathSep);
fsetGold = false;
}
else
{
- cout << args.help.str();
+ cout << args.getHelpMessage();
fSuccess = false;
}
}
@@ -231,13 +327,13 @@
}
else
{
- cout << args.help.str();
+ cout << args.getHelpMessage();
fSuccess = false;
}
}
else
{
- cout << args.help.str();
+ cout << args.getHelpMessage();
fSuccess = false;
}
}
@@ -250,7 +346,7 @@
}
else
{
- cout << args.help.str();
+ cout << args.getHelpMessage();
fSuccess = false;
}
}
@@ -269,13 +365,13 @@
}
else
{
- cout << args.help.str();
+ cout << args.getHelpMessage();
fSuccess = false;
}
}
else
{
- cout << args.help.str();
+ cout << args.getHelpMessage();
fSuccess = false;
}
@@ -285,7 +381,7 @@
//
if (fsetOut)
{
- unsigned int ii = lastIndexOf(args.base,charAt(pathSep,0));
+ unsigned int ii = lastIndexOf(args.base,charAt(s_pathSep,0));
if (ii < length(args.base))
{
@@ -294,7 +390,7 @@
append(args.output,XalanDOMString(outDir));
checkAndCreateDir(args.output);
- append(args.output,pathSep);
+ append(args.output,s_pathSep);
}
// Do we need to set the default gold directory??
@@ -308,13 +404,13 @@
cout << "Assumed Gold dir - " << c_str(TranscodeToLocalCodePage(args.gold)) << " - does not exist" << endl;
fSuccess = false;
}
- append(args.gold,pathSep);
+ append(args.gold,s_pathSep);
}
// Add the path seperator to the end of the base directory
// here after we've finished using it for all directory creation.
//
- append(args.base,pathSep);
+ append(args.base,s_pathSep);
return fSuccess;
}
@@ -341,11 +437,11 @@
// garnered from XSLTMARK performance directory exm.
if (useDirPrefix)
{
- assign(searchSpecification, baseDir + relDir + pathSep + relDir + searchSuffix);
+ assign(searchSpecification, baseDir + relDir + s_pathSep + relDir + searchSuffix);
}
else
{
- assign(searchSpecification, baseDir + relDir + pathSep + searchSuffix);
+ assign(searchSpecification, baseDir + relDir + s_pathSep + searchSuffix);
}
@@ -1273,6 +1369,36 @@
}
+#if !defined(NDEBUG)
+void
+FileUtility::debugNodeData(const XalanDOMString& value) const
+{
+ cout << "Node is: " << c_str(TranscodeToLocalCodePage(value)) << endl;
+}
+
+
+
+void
+FileUtility::debugNodeData(
+ const XalanDOMString& node,
+ const XalanDOMString& value) const
+{
+ cout << "Node is: " << c_str(TranscodeToLocalCodePage(node)) << " "
+ << "Value is: \"" << c_str(TranscodeToLocalCodePage(value)) << "\"\n";
+}
+
+
+
+void
+FileUtility::debugAttributeData(const XalanDOMString& value) const
+{
+ cout << "Attribute is: " << c_str(TranscodeToLocalCodePage(value)) << endl;
+}
+
+#endif
+
+
+
/* This routine collects up data pertinent to a dom comparison failure.
// Inputs:
// errmsg: Reason for the failure.
@@ -1397,4 +1523,37 @@
<< xalan.getLastError()
<< endl;
}
+}
+
+
+
+static XalanDOMString s_xmlSuffix;
+static XalanDOMString s_pathSep;
+
+
+
+const XalanDOMString& FileUtility::s_xmlSuffix = ::s_xmlSuffix;
+const XalanDOMString& FileUtility::s_pathSep = ::s_pathSep;
+
+
+
+void
+FileUtility::initialize()
+{
+ ::s_xmlSuffix = XALAN_STATIC_UCODE_STRING(".xml");
+
+#if defined(WIN32)
+ ::s_pathSep = XALAN_STATIC_UCODE_STRING("\\");
+#else
+ ::s_pathSep = XALAN_STATIC_UCODE_STRING("/");
+#endif
+}
+
+
+
+void
+FileUtility::terminate()
+{
+ releaseMemory(::s_pathSep);
+ releaseMemory(::s_xmlSuffix);
}
1.26 +109 -84 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.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- FileUtility.hpp 13 Dec 2001 20:18:08 -0000 1.25
+++ FileUtility.hpp 22 Jan 2002 18:47:59 -0000 1.26
@@ -59,60 +59,23 @@
#if !defined(FILEUTILITY_HEADER_GUARD_1357924680)
#define FILEUTILITY_HEADER_GUARD_1357924680
-#include<string>
-#include<stdio.h>
-#include <time.h>
+#include <Harness/HarnessDefinitions.hpp>
-#if defined(XALAN_OLD_STREAM_HEADERS)
-#include <iostream.h>
-#include <sstream.h>
-#else
-#include <iostream>
-#include <sstream>
-#endif
-
-// XERCES HEADERS ...
-// Are included in HarnessInit.hpp
-
-// XALAN HEADERS...
-#include <PlatformSupport/XalanOutputStreamPrintWriter.hpp>
-#include <PlatformSupport/XalanFileOutputStream.hpp>
-#include <PlatformSupport/DirectoryEnumerator.hpp>
-#include <PlatformSupport/DOMStringHelper.hpp>
-#include <XPath/XObjectFactoryDefault.hpp>
-#include <XPath/XPathFactoryDefault.hpp>
-#include <XMLSupport/FormatterToXML.hpp>
-#include <XMLSupport/FormatterTreeWalker.hpp>
+#include <vector>
-#include <XalanSourceTree/XalanSourceTreeDOMSupport.hpp>
-#include <XalanSourceTree/XalanSourceTreeParserLiaison.hpp>
-#include <XalanSourceTree/XalanSourceTreeDocument.hpp>
-#include <XalanTransformer/XalanCompiledStylesheetDefault.hpp>
-#include <XalanTransformer/XalanTransformer.hpp>
-
-#include "XMLFileReporter.hpp"
+#if defined(XALAN_OLD_STREAM_HEADERS)
+#include <strstream.h>
+#else
+#include <strstream>
+#endif
-using namespace std;
-/**
- * Utility call that extracts test file names from testsuite.
- * @author Paul Dick@lotus.com
- * @version $Id: FileUtility.hpp,v 1.25 2001/12/13 20:18:08 pauldick Exp $
- */
+#include <XalanDOM/XalanDOMString.hpp>
-#if !defined(WIN32)
-#define HARNESS_API
-#else
-#if defined(HARNESS_EXPORTS)
-#define HARNESS_API __declspec(dllexport)
-#else
-#define HARNESS_API __declspec(dllimport)
-#endif
-#endif
// Misc typedefs and Global variables.
@@ -121,26 +84,43 @@
typedef vector<XalanDOMString> FileNameVectorType;
#else
typedef std::vector<XalanDOMString> FileNameVectorType;
- using std::ostringstream;
#endif
-// Basic Global variables used by many tests.
-//const XalanDOMString XSLSuffix(XALAN_STATIC_UCODE_STRING(".xsl"));
-const XalanDOMString XMLSuffix(XALAN_STATIC_UCODE_STRING(".xml"));
+class FormatterListener;
+class PrintWriter;
+class StylesheetRoot;
+class XalanCompiledStylesheet;
+class XalanNode;
+class XalanSourceTreeDocument;
+class XalanTransformer;
+class XMLFileReporter;
+class XSLTInputSource;
+
-#if defined(WIN32)
-const XalanDOMString pathSep(XALAN_STATIC_UCODE_STRING("\\"));
-#else
-const XalanDOMString pathSep(XALAN_STATIC_UCODE_STRING("/"));
-#endif
// This class is exported from the Harness.dll
class HARNESS_API FileUtility
{
public:
- struct reportStruct
+ /**
+ * Initialize static data.
+ * Should be called only once per process before creating any
+ * instances of FileUtility.
+ */
+ static void
+ initialize();
+
+ /**
+ * Clean-up static data.
+ * Should be called only once per process after deleting all
+ * instances of FileUtility.
+ */
+ static void
+ terminate();
+
+ struct HARNESS_API reportStruct
{
XalanDOMString theDrive;
XalanDOMString testOrFile;
@@ -155,19 +135,27 @@
int fail;
int nogold;
- void reset()
- {
- clear(testOrFile);
- msg = "";
- clear(currentNode);
- clear(actual);
- clear(expected);
- }
+ reportStruct();
+
+ void
+ reset();
+
} data;
- struct cmdParams
+ struct HARNESS_API cmdParams
{
- ostringstream help;
+ private:
+
+#if defined(XALAN_NO_NAMESPACES)
+ ostrstream help;
+#else
+ std::ostrstream help;
+#endif
+
+ char* data;
+
+ public:
+
XalanDOMString base;
XalanDOMString output;
XalanDOMString gold;
@@ -176,13 +164,40 @@
bool skip;
long iters;
+
+ cmdParams();
+
+ ~cmdParams()
+ {
+ delete [] data;
+ }
+
+ const char*
+ getHelpMessage()
+ {
+ delete [] data;
+
+ help << '\0';
+
+ data = help.str();
+
+ return data;
+ }
+
+#if defined(XALAN_NO_NAMESPACES)
+ ostream&
+#else
+ std::ostream&
+#endif
+ getHelpStream()
+ {
+ return help;
+ }
+
} args;
/** Simple constructor, does not perform initialization. */
- FileUtility()
- {
- cout << endl << "Using Xerces Version " << gXercesFullVersionStr << endl;
- }
+ FileUtility();
/**
* Utility method used to get test files from a specific directory.
@@ -361,6 +376,10 @@
void
analyzeResults(XalanTransformer& xalan, const XalanDOMString& resultsFile);
+ static const XalanDOMString& s_xmlSuffix;
+
+ static const XalanDOMString& s_pathSep;
+
private:
XalanDOMString
@@ -384,35 +403,41 @@
void
reportError();
+#if defined(NDEBUG)
void
- debugNodeData(const XalanDOMString& value)
+ debugNodeData(const XalanDOMString& /* value */) const
{
-#if !defined(NDEBUG) && defined(_MSC_VER)
- cout << "Node is: " << c_str(TranscodeToLocalCodePage(value)) << endl;
-#endif
}
void
debugNodeData(
- const XalanDOMString& node,
- const XalanDOMString& value)
+ const XalanDOMString& /* node */,
+ const XalanDOMString& /* value */) const
{
-#if !defined(NDEBUG) && defined(_MSC_VER)
- cout << "Node is: " << c_str(TranscodeToLocalCodePage(node)) << " "
- << "Value is: \"" << c_str(TranscodeToLocalCodePage(value)) << "\"\n";
-#endif
}
void
- debugAttributeData(const XalanDOMString& value)
+ debugAttributeData(const XalanDOMString& /* value */) const
{
-#if !defined(NDEBUG) && defined(_MSC_VER)
- cout << "Attribute is: " << c_str(TranscodeToLocalCodePage(value)) << endl;
-#endif
}
-}; // end of class FileUtility
+#else
+ void
+ debugNodeData(const XalanDOMString& value) const;
+
+ void
+ debugNodeData(
+ const XalanDOMString& node,
+ const XalanDOMString& value) const;
+
+ void
+ debugAttributeData(const XalanDOMString& value) const;
#endif
+}; // end of class FileUtility
+
+
+
+#endif
1.14 +12 -4 xml-xalan/c/Tests/Harness/Harness.dsp
Index: Harness.dsp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/Harness/Harness.dsp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- Harness.dsp 18 Oct 2001 15:36:52 -0000 1.13
+++ Harness.dsp 22 Jan 2002 18:47:59 -0000 1.14
@@ -44,7 +44,7 @@
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HARNESS_EXPORTS" /Yu"stdafx.h" /FD /c
-# ADD CPP /nologo /MD /W4 /GR /GX /O2 /Ob2 /I "..\..\..\..\xml-xerces\c\src" /I "..\..\src\\" /I "..\harness\\" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HARNESS_EXPORTS" /FD /c
+# ADD CPP /nologo /MD /W4 /GR /GX /O2 /Ob2 /I "..\..\..\..\xml-xerces\c\src" /I "..\..\src\\" /I ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HARNESS_EXPORTS" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
@@ -71,7 +71,7 @@
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HARNESS_EXPORTS" /Yu"stdafx.h" /FD /GZ /c
-# ADD CPP /nologo /MDd /W4 /Gm /GR /GX /Zi /Od /Gf /Gy /I "..\..\..\..\xml-xerces\c\src" /I "..\..\src\\" /I "..\harness\\" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HARNESS_EXPORTS" /Yc /FD /GZ /c
+# ADD CPP /nologo /MDd /W4 /Gm /GR /GX /Zi /Od /Gf /Gy /I "..\..\..\..\xml-xerces\c\src" /I "..\..\src\\" /I ".." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HARNESS_EXPORTS" /Yc /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
@@ -99,7 +99,7 @@
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W4 /GR /GX /O2 /Ob2 /I "..\..\..\..\xml-xerces\c\src" /I "..\..\src\\" /I "..\harness\\" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HARNESS_EXPORTS" /FD /c
-# ADD CPP /nologo /MD /W4 /GR /GX /Zi /O2 /Ob2 /I "..\..\..\..\xml-xerces\c\src" /I "..\..\src\\" /I "..\harness\\" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HARNESS_EXPORTS" /FD /c
+# ADD CPP /nologo /MD /W4 /GR /GX /Zi /O2 /Ob2 /I "..\..\..\..\xml-xerces\c\src" /I "..\..\src\\" /I ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HARNESS_EXPORTS" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
@@ -110,7 +110,7 @@
LINK32=link.exe
# ADD BASE LINK32 ..\..\..\..\xml-xerces\c\Build\Win32\VC6\Release\xerces-c_1.lib ..\..\Build\Win32\VC6\Release\PlatformSupport.lib ..\..\Build\Win32\VC6\Release\XalanDOM.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /machine:I386
# SUBTRACT BASE LINK32 /debug
-# ADD LINK32 ..\..\..\..\xml-xerces\c\Build\Win32\VC6\Release\xerces-c_1.lib ..\..\Build\Win32\VC6\Release.symbols\PlatformSupportS.lib ..\..\Build\Win32\VC6\Release.symbols\DOMSupportS.lib ..\..\Build\Win32\VC6\Release.symbols\XalanDOMS.lib ..\..\Build\Win32\VC6\Release.symbols\XMLSupportS.lib ..\..\Build\Win32\VC6\Release.symbols\XalanSourceTreeS.lib ..\..\Build\Win32\VC6\Release.symbols\XSLTS.lib /nologo /dll /debug /machine:I386
+# ADD LINK32 ..\..\..\..\xml-xerces\c\Build\Win32\VC6\Release\xerces-c_1.lib ..\..\Build\Win32\VC6\Release.symbols\PlatformSupportS.lib ..\..\Build\Win32\VC6\Release.symbols\DOMSupportS.lib ..\..\Build\Win32\VC6\Release.symbols\XalanDOMS.lib ..\..\Build\Win32\VC6\Release.symbols\XMLSupportS.lib ..\..\Build\Win32\VC6\Release.symbols\XalanSourceTreeS.lib ..\..\Build\Win32\VC6\Release.symbols\XSLTS.lib ..\..\Build\Win32\VC6\Release.symbols\XalanTransformerS.lib /nologo /dll /debug /machine:I386
# SUBTRACT LINK32 /incremental:yes
!ENDIF
@@ -140,6 +140,10 @@
# End Source File
# Begin Source File
+SOURCE=.\HarnessInit.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\XMLFileReporter.cpp
!IF "$(CFG)" == "Harness - Win32 Release"
@@ -160,6 +164,10 @@
# Begin Source File
SOURCE=.\FileUtility.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\HarnessDefinitions.hpp
# End Source File
# Begin Source File
1.3 +11 -42 xml-xalan/c/Tests/Harness/HarnessInit.hpp
Index: HarnessInit.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/Harness/HarnessInit.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- HarnessInit.hpp 13 Jul 2001 20:48:35 -0000 1.2
+++ HarnessInit.hpp 22 Jan 2002 18:47:59 -0000 1.3
@@ -59,52 +59,21 @@
#if !defined(HARNESSINIT_HEADER_GUARD_1357924690)
#define HARNESSINIT_HEADER_GUARD_1357924690
+#include <Harness/HarnessDefinitions.hpp>
-#include<string>
-#include<stdio.h>
-#include <time.h>
-
-// Base header file. Must be first...
-// Not sure what this is refering to, but it was in front of the PlatformDefinitions include??
-// XERCES HEADERS...
-#include <Include/PlatformDefinitions.hpp>
-#include <util/XercesDefs.hpp>
-#include <util/PlatformUtils.hpp>
-
-using namespace std;
-
-
-/**
- * Utility call that extracts test file names from testsuite.
- * @author Paul Dick@lotus.com
- * @version $Id: HarnessInit.hpp,v 1.2 2001/07/13 20:48:35 pauldick Exp $
- */
-// This is all commented out because these are inline methods, there is no
-// .cpp file associated.
-#if 0
-#if defined HARNESS_EXPORTS
-#define HARNESS_API __declspec(dllexport)
-#else
-#define HARNESS_API __declspec(dllimport)
-#endif
-#endif
-// This class is exported from the Harness.dll
-class HarnessInit
-{
+// This class is exported from the Harness.dll
+class HARNESS_API HarnessInit
+{
public:
/** Simple constructor, performs initialization. */
- HarnessInit::HarnessInit()
- {
- XMLPlatformUtils::Initialize();
- }
-
- HarnessInit::~HarnessInit()
- {
- XMLPlatformUtils::Terminate();
- }
-}; // end of class HarnessInit
-#endif
+ HarnessInit();
+
+ ~HarnessInit();
+};
+
+
+#endif
1.13 +66 -9 xml-xalan/c/Tests/Harness/XMLFileReporter.cpp
Index: XMLFileReporter.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/Harness/XMLFileReporter.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- XMLFileReporter.cpp 3 Dec 2001 21:28:56 -0000 1.12
+++ XMLFileReporter.cpp 22 Jan 2002 18:47:59 -0000 1.13
@@ -1,17 +1,74 @@
/*
-*
-* XMLFileReporter.cpp
-*
-* Copyright 2000 Lotus Development Corporation. All rights reserved.
-* This software is subject to the Lotus Software Agreement, Restricted
-* Rights for U.S. government users and applicable export regulations.
-*/
+ * The Apache Software License, Version 1.1
+ *
+ *
+ * Copyright (c) 1999-2001 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ * if any, must include the following acknowledgment:
+ * "This product includes software developed by the
+ * Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xalan" and "Apache Software Foundation" must
+ * not be used to endorse or promote products derived from this
+ * software without prior written permission. For written
+ * permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ * nor may "Apache" appear in their name, without prior written
+ * permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ *
+ */
-#include <stdlib.h>
#include "XMLFileReporter.hpp"
-#include "PlatformSupport/XalanUnicode.hpp"
+
+#include <cstdlib>
+#include <ctime>
+
+
+
+#include <PlatformSupport/DOMStringHelper.hpp>
+#include <PlatformSupport/XalanUnicode.hpp>
+
const XalanDOMString XMLFileReporter::OPT_FILENAME("filename");
1.9 +14 -19 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.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- XMLFileReporter.hpp 3 Dec 2001 21:28:55 -0000 1.8
+++ XMLFileReporter.hpp 22 Jan 2002 18:47:59 -0000 1.9
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999-2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -54,35 +54,30 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
- * XMLFileReporter.hpp
+ *
*/
#if !defined(HARNESS_HEADER_GUARD_1357924680)
#define HARNESS_HEADER_GUARD_1357924680
-#include<stdio.h>
-#include <time.h>
-//#include <util/PlatformUtils.hpp>
-#include <PlatformSupport/DOMStringHelper.hpp>
-#include<map>
+#include <Harness/HarnessDefinitions.hpp>
+
+
+
+#include <map>
+
+
+
+#include <XalanDOM/XalanDOMString.hpp>
+
+
/**
* Reporter that saves output to a simple XML-format file.
* @author Shane_Curcuru@lotus.com
- * @version $Id: XMLFileReporter.hpp,v 1.8 2001/12/03 21:28:55 dbertoni Exp $
+ * @version $Id: XMLFileReporter.hpp,v 1.9 2002/01/22 18:47:59 dbertoni Exp $
*/
-
-#if !defined(WIN32)
-#define HARNESS_API
-#else
-#if defined(HARNESS_EXPORTS)
-#define HARNESS_API __declspec(dllexport)
-#else
-#define HARNESS_API __declspec(dllimport)
-#endif
-#endif
-
#if defined(XALAN_NO_NAMESPACES)
typedef map<XalanDOMString, XalanDOMString, less<XalanDOMString> > Hashtable;
1.1 xml-xalan/c/Tests/Harness/HarnessDefinitions.hpp
Index: HarnessDefinitions.hpp
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999-2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, International
* Business Machines, Inc., http://www.ibm.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
#if !defined(HARNESSDEFINITIONS_HEADER_GUARD_1357924680)
#define HARNESSDEFINITIONS_HEADER_GUARD_1357924680
#include <Include/PlatformDefinitions.hpp>
#if defined(HARNESS_EXPORTS)
# define HARNESS_API XALAN_PLATFORM_EXPORT
# define HARNESS_API_FUNCTION(T) XALAN_PLATFORM_EXPORT_FUNCTION(T)
#else
# define HARNESS_API XALAN_PLATFORM_IMPORT
# define HARNESS_API_FUNCTION(T) XALAN_PLATFORM_IMPORT_FUNCTION(T)
#endif
#endif // HARNESSDEFINITIONS_HEADER_GUARD_1357924680
1.1 xml-xalan/c/Tests/Harness/HarnessInit.cpp
Index: HarnessInit.cpp
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999-2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xalan" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, International
* Business Machines, Inc., http://www.ibm.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*
*/
#include "HarnessInit.hpp"
#include <util/PlatformUtils.hpp>
#include <XalanDOM/XalanDOMInit.hpp>
#include "FileUtility.hpp"
static const XalanDOMInit* s_xalanDOMInit = 0;
HarnessInit::HarnessInit()
{
assert(s_xalanDOMInit == 0);
XMLPlatformUtils::Initialize();
s_xalanDOMInit = new XalanDOMInit;
FileUtility::initialize();
}
HarnessInit::~HarnessInit()
{
FileUtility::terminate();
delete s_xalanDOMInit;
s_xalanDOMInit = 0;
XMLPlatformUtils::Terminate();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org