You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by pa...@apache.org on 2001/02/07 16:37:15 UTC

cvs commit: xml-xalan/c/Tests/Harness Harness.dsp XMLFileReporter.cpp XMLFileReporter.hpp

pauldick    01/02/07 07:37:15

  Modified:    c/Tests/Harness Harness.dsp XMLFileReporter.cpp
                        XMLFileReporter.hpp
  Log:
  Revamped with new directory iteration to locate test files
  
  Revision  Changes    Path
  1.4       +33 -7     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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Harness.dsp	2001/01/09 20:32:50	1.3
  +++ Harness.dsp	2001/02/07 15:37:14	1.4
  @@ -39,11 +39,11 @@
   # PROP Use_MFC 0
   # PROP Use_Debug_Libraries 0
   # PROP Output_Dir "..\..\Build\Win32\VC6\Release"
  -# PROP Intermediate_Dir "..\..\Build\Win32\VC6\Release\Performance"
  +# PROP Intermediate_Dir "..\..\Build\Win32\VC6\Release\Harness"
   # 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 /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 "..\harness\\" /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"
  @@ -53,8 +53,8 @@
   # ADD BSC32 /nologo
   LINK32=link.exe
   # ADD BASE LINK32 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 /machine:I386
  -# ADD LINK32 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 /machine:I386
  -# SUBTRACT LINK32 /incremental:yes /debug
  +# ADD 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 LINK32 /debug
   
   !ELSEIF  "$(CFG)" == "Harness - Win32 Debug"
   
  @@ -66,11 +66,11 @@
   # PROP Use_MFC 0
   # PROP Use_Debug_Libraries 1
   # PROP Output_Dir "..\..\Build\Win32\VC6\Debug"
  -# PROP Intermediate_Dir "..\..\Build\Win32\VC6\Debug\Performance"
  +# PROP Intermediate_Dir "..\..\Build\Win32\VC6\Debug\Harness"
   # 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 /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 "..\harness\\" /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"
  @@ -80,7 +80,7 @@
   # ADD BSC32 /nologo
   LINK32=link.exe
   # ADD BASE LINK32 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 /debug /machine:I386 /pdbtype:sept
  -# ADD LINK32 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 /debug /machine:I386 /pdbtype:sept
  +# ADD 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 /debug /machine:I386 /pdbtype:sept
   # SUBTRACT LINK32 /incremental:no
   
   !ENDIF 
  @@ -94,12 +94,38 @@
   # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
   # Begin Source File
   
  +SOURCE=.\FileUtility.cpp
  +
  +!IF  "$(CFG)" == "Harness - Win32 Release"
  +
  +!ELSEIF  "$(CFG)" == "Harness - Win32 Debug"
  +
  +# ADD CPP /YX
  +
  +!ENDIF 
  +
  +# End Source File
  +# Begin Source File
  +
   SOURCE=.\XMLFileReporter.cpp
  +
  +!IF  "$(CFG)" == "Harness - Win32 Release"
  +
  +!ELSEIF  "$(CFG)" == "Harness - Win32 Debug"
  +
  +# ADD CPP /YX
  +
  +!ENDIF 
  +
   # End Source File
   # End Group
   # Begin Group "Header Files"
   
   # PROP Default_Filter "h;hpp;hxx;hm;inl"
  +# Begin Source File
  +
  +SOURCE=.\FileUtility.hpp
  +# End Source File
   # Begin Source File
   
   SOURCE=.\XMLFileReporter.hpp
  
  
  
  1.3       +125 -82   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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XMLFileReporter.cpp	2001/01/08 22:23:38	1.2
  +++ XMLFileReporter.cpp	2001/02/07 15:37:14	1.3
  @@ -6,44 +6,46 @@
   * This software is subject to the Lotus Software Agreement, Restricted
   * Rights for U.S. government users and applicable export regulations.
   */
  -#include "XMLFileReporter.hpp" 
  +
   #include <stdlib.h>
  +#include "XMLFileReporter.hpp" 
  +
   
  +#include "PlatformSupport/XalanUnicode.hpp"
   
  -const string  XMLFileReporter::OPT_FILENAME = "filename";
   
  -const string  XMLFileReporter::ELEM_RESULTSFILE = "resultsfile";
  -const string  XMLFileReporter::ELEM_TESTFILE = "testfile";
  -const string  XMLFileReporter::ELEM_FILERESULT = "fileresult";
  -const string  XMLFileReporter::ELEM_TESTCASE = "testcase";
  -const string  XMLFileReporter::ELEM_CASERESULT = "caseresult";
  -const string  XMLFileReporter::ELEM_CHECKRESULT = "checkresult";
  -const string  XMLFileReporter::ELEM_STATISTIC = "statistic";
  -const string  XMLFileReporter::ELEM_LONGVAL = "longval";
  -const string  XMLFileReporter::ELEM_DOUBLEVAL = "doubleval";
  -const string  XMLFileReporter::ELEM_MESSAGE = "message";
  -const string  XMLFileReporter::ELEM_ARBITRARY = "arbitrary";
  -const string  XMLFileReporter::ELEM_HASHTABLE = "hashtable";
  -const string  XMLFileReporter::ELEM_HASHITEM = "hashitem";
  -
  -const string  XMLFileReporter::ATTR_LEVEL = "level";
  -const string  XMLFileReporter::ATTR_DESC = "desc";
  -const string  XMLFileReporter::ATTR_TIME = "time";
  -const string  XMLFileReporter::ATTR_RESULT = "result";
  -const string  XMLFileReporter::ATTR_KEY = "key";
  -const string  XMLFileReporter::ATTR_FILENAME = XMLFileReporter::OPT_FILENAME;
  -
  -const string XMLFileReporter::TESTCASEINIT_HDR = "<" + ELEM_TESTCASE + " " + ATTR_DESC + "=\"";
  -const string XMLFileReporter::TESTCASECLOSE_HDR = "<" + ELEM_CASERESULT + " " + ATTR_DESC + "=\"";
  -const string XMLFileReporter::MESSAGE_HDR = "<" + ELEM_MESSAGE + " " + ATTR_LEVEL + "=\"";
  -const string XMLFileReporter::STATISTIC_HDR = "<" + ELEM_STATISTIC + " " + ATTR_LEVEL + "=\"";
  -const string XMLFileReporter::ARBITRARY_HDR = "<" + ELEM_ARBITRARY + " " + ATTR_LEVEL + "=\"";
  -const string XMLFileReporter::HASHTABLE_HDR = "<" + ELEM_HASHTABLE + " " + ATTR_LEVEL + "=\"";
  -const string XMLFileReporter::HASHITEM_HDR = "  <" + ELEM_HASHITEM + " " + ATTR_KEY + "=\"";
  -const string XMLFileReporter::CHECKPASS_HDR = "<" + ELEM_CHECKRESULT + " " + ATTR_RESULT + "=\"" + "PASS" + "\" " + ATTR_DESC + "=\"";
  -const string XMLFileReporter::CHECKAMBG_HDR = "<" + ELEM_CHECKRESULT + " " + ATTR_RESULT + "=\"" + "AMBG" + "\" " + ATTR_DESC + "=\"";
  -const string XMLFileReporter::CHECKERRR_HDR = "<" + ELEM_CHECKRESULT + " " + ATTR_RESULT + "=\"" + "ERRR" + "\" " + ATTR_DESC + "=\"";
  -const string XMLFileReporter::CHECKFAIL_HDR = "<" + ELEM_CHECKRESULT + " " + ATTR_RESULT + "=\"" + "FAIL" + "\" " + ATTR_DESC + "=\"";
  +const XalanDOMString  XMLFileReporter::OPT_FILENAME("filename");
  +const XalanDOMString  XMLFileReporter::ELEM_RESULTSFILE("resultsfile");
  +const XalanDOMString  XMLFileReporter::ELEM_TESTFILE("testfile");
  +const XalanDOMString  XMLFileReporter::ELEM_FILERESULT("fileresult");
  +const XalanDOMString  XMLFileReporter::ELEM_TESTCASE("testcase");
  +const XalanDOMString  XMLFileReporter::ELEM_CASERESULT("caseresult");
  +const XalanDOMString  XMLFileReporter::ELEM_CHECKRESULT("checkresult");
  +const XalanDOMString  XMLFileReporter::ELEM_STATISTIC("statistic");
  +const XalanDOMString  XMLFileReporter::ELEM_LONGVAL("longval");
  +const XalanDOMString  XMLFileReporter::ELEM_DOUBLEVAL("doubleval");
  +const XalanDOMString  XMLFileReporter::ELEM_MESSAGE("message");
  +const XalanDOMString  XMLFileReporter::ELEM_ARBITRARY("arbitrary");
  +const XalanDOMString  XMLFileReporter::ELEM_HASHTABLE("hashtable");
  +const XalanDOMString  XMLFileReporter::ELEM_HASHITEM("hashitem");
  +const XalanDOMString  XMLFileReporter::ATTR_LEVEL("level");
  +const XalanDOMString  XMLFileReporter::ATTR_DESC("desc");
  +const XalanDOMString  XMLFileReporter::ATTR_TIME("time");
  +const XalanDOMString  XMLFileReporter::ATTR_RESULT("result");
  +const XalanDOMString  XMLFileReporter::ATTR_KEY("key");
  +const XalanDOMString  XMLFileReporter::ATTR_FILENAME = XMLFileReporter::OPT_FILENAME;
  +
  +const XalanDOMString XMLFileReporter::TESTCASEINIT_HDR("<" + ELEM_TESTCASE + " " + ATTR_DESC + "=\"");
  +const XalanDOMString XMLFileReporter::TESTCASECLOSE_HDR("<" + ELEM_CASERESULT + " " + ATTR_DESC + "=\"");
  +const XalanDOMString XMLFileReporter::MESSAGE_HDR("<" + ELEM_MESSAGE + " " + ATTR_LEVEL + "=\"");
  +const XalanDOMString XMLFileReporter::STATISTIC_HDR("<" + ELEM_STATISTIC + " " + ATTR_LEVEL + "=\"");
  +const XalanDOMString XMLFileReporter::ARBITRARY_HDR("<" + ELEM_ARBITRARY + " " + ATTR_LEVEL + "=\"");
  +const XalanDOMString XMLFileReporter::HASHTABLE_HDR("<" + ELEM_HASHTABLE + " " + ATTR_LEVEL + "=\"");
  +const XalanDOMString XMLFileReporter::HASHITEM_HDR("  <" + ELEM_HASHITEM + " " + ATTR_KEY + "=\"");
  +const XalanDOMString XMLFileReporter::CHECKPASS_HDR("<" + ELEM_CHECKRESULT + " " + ATTR_RESULT + "=\"" + "PASS" + "\" " + ATTR_DESC + "=\"");
  +const XalanDOMString XMLFileReporter::CHECKAMBG_HDR("<" + ELEM_CHECKRESULT + " " + ATTR_RESULT + "=\"" + "AMBG" + "\" " + ATTR_DESC + "=\"");
  +const XalanDOMString XMLFileReporter::CHECKERRR_HDR("<" + ELEM_CHECKRESULT + " " + ATTR_RESULT + "=\"" + "ERRR" + "\" " + ATTR_DESC + "=\"");
  +const XalanDOMString XMLFileReporter::CHECKFAIL_HDR("<" + ELEM_CHECKRESULT + " " + ATTR_RESULT + "=\"" + "FAIL" + "\" " + ATTR_DESC + "=\"");
   
   
   
  @@ -59,7 +61,7 @@
   
   
   
  -XMLFileReporter::XMLFileReporter(const string& fileName):
  +XMLFileReporter::XMLFileReporter(const XalanDOMString& fileName):
   	m_anyOutput(false),
   	m_fileName(fileName),
   	m_fileHandle(0),
  @@ -70,12 +72,21 @@
       m_ready = initialize();
   }
   
  -
  +XMLFileReporter::XMLFileReporter(const char* fileName):
  +	m_anyOutput(false),
  +	m_fileName(XalanDOMString(fileName)),
  +	m_fileHandle(0),
  +	m_ready(false),
  +	m_error(false),
  +	m_flushOnCaseClose(true)
  +{         
  +    m_ready = initialize();
  +}
   
   bool 
   XMLFileReporter::initialize()
   {   	
  -    if (m_fileName.length == 0)
  +    if (length(m_fileName) == 0)
       {
           // We don't have a valid file, so bail
           m_error = true;
  @@ -85,7 +96,7 @@
       }
   
       // Create a file and ensure it has a place to live
  -	m_fileHandle = fopen(m_fileName.c_str(), "w");
  +	m_fileHandle = fopen(&m_fileName.transcode().front(), "w");
   	if (m_fileHandle == 0)
   	{
           // Couldn't create or find the directory for the file to live in, so bail
  @@ -112,7 +123,7 @@
   
   
   
  -const string& 
  +const XalanDOMString& 
   XMLFileReporter::getFileName() const
   {
       return(m_fileName);
  @@ -121,7 +132,7 @@
   
   
   void 
  -XMLFileReporter::setFileName(const string& fileName)
  +XMLFileReporter::setFileName(const XalanDOMString& fileName)
   {
   	m_fileName = fileName;
   }
  @@ -186,7 +197,7 @@
   
   
   void 
  -XMLFileReporter::logTestFileInit(const string& msg)
  +XMLFileReporter::logTestFileInit(const XalanDOMString& msg)
   {
       if (isReady())
       {
  @@ -198,7 +209,7 @@
   
   
   void 
  -XMLFileReporter::logTestFileClose(const string& msg, const string& result)
  +XMLFileReporter::logTestFileClose(const XalanDOMString& msg, const XalanDOMString& result)
   {
       if (isReady())
       {
  @@ -212,7 +223,7 @@
   
   
   void 
  -XMLFileReporter::logTestCaseInit(const string& msg)
  +XMLFileReporter::logTestCaseInit(const XalanDOMString& msg)
   {
       if (isReady())
       {
  @@ -223,7 +234,7 @@
   
   
   void 
  -XMLFileReporter::logTestCaseClose(const string& msg, const string& result)
  +XMLFileReporter::logTestCaseClose(const XalanDOMString& msg, const XalanDOMString& result)
   {
       if (isReady())
       {
  @@ -239,7 +250,7 @@
   
   
   void 
  -XMLFileReporter::logMessage(int level, const string& msg)
  +XMLFileReporter::logMessage(int level, const XalanDOMString& msg)
   {
   	char tmp[20];
   	sprintf(tmp, "%d", level);
  @@ -255,25 +266,31 @@
   
   
   void 
  -XMLFileReporter::logStatistic (int level, long lVal, double dVal, const string& msg)
  +XMLFileReporter::logStatistic (int level, long lVal, double dVal, const XalanDOMString& msg)
   {
  -    if (isReady())
  + 	char tmp[20];
  +
  +
  +	if (isReady())
       {
  -        //printToFile(STATISTIC_HDR + level + "\" " + ATTR_DESC + "=\"" + escapestring(msg) + "\">");
  -        fprintf(m_fileHandle, "%s%d%s%s%s%s%s", STATISTIC_HDR.c_str(), level, "\" ", ATTR_DESC.c_str(), "=\"", escapestring(msg).c_str(), "\">\n");
  -		//printToFile("<" + ELEM_LONGVAL + ">" + lVal + "</" + ELEM_LONGVAL + ">");
  -		fprintf(m_fileHandle, "%s%s%s%d%s%s%s", "<", ELEM_LONGVAL.c_str(), ">", lVal, "</", ELEM_LONGVAL.c_str(), ">\n");
  -        //printToFile("<" + ELEM_DOUBLEVAL + ">" + dVal + "</" + ELEM_DOUBLEVAL + ">");
  -		fprintf(m_fileHandle, "%s%s%s%f%s%s%s", "<", ELEM_DOUBLEVAL.c_str(), ">", dVal, "</", ELEM_DOUBLEVAL.c_str(), ">\n");
  -        printToFile("</" + ELEM_STATISTIC + ">");
  +		sprintf(tmp, "%d", level);
  +        printToFile(STATISTIC_HDR + tmp + "\" " + ATTR_DESC + "=\"" + escapestring(msg) + "\">");
  +		
  +		sprintf(tmp, "%d", lVal);
  +		printToFile("<" + ELEM_LONGVAL + ">" + tmp + "</" + ELEM_LONGVAL + ">");
   		
  +		sprintf(tmp, "%d", dVal);
  +        printToFile("<" + ELEM_DOUBLEVAL + ">" + tmp + "</" + ELEM_DOUBLEVAL + ">");
  +        
  +		printToFile("</" + ELEM_STATISTIC + ">");
  +		
       }
   }
   
   
   
   void 
  -XMLFileReporter::logArbitraryMessage (int level, const string& msg)
  +XMLFileReporter::logArbitraryMessage (int level, const XalanDOMString& msg)
   {
   	char tmp[20];
   	sprintf(tmp, "%d", level);
  @@ -287,7 +304,7 @@
   }
   
   /*
  -void logHashtable (int level, Hashtable hash, string msg)
  +void logHashtable (int level, Hashtable hash, XalanDOMString msg)
   {
       if (isReady())
       {
  @@ -303,7 +320,7 @@
               {
                   Object key = enum.nextElement();
                   // Ensure we'll have clean output by pre-fetching value before outputting anything
  -                string value = hash.get(key).tostring();
  +                XalanDOMString value = hash.get(key).tostring();
                   printToFile(HASHITEM_HDR + key.tostring() + "\">");
                   printToFile(value);
                   printToFile("</" + ELEM_HASHITEM + ">");
  @@ -321,7 +338,7 @@
   
   
   void 
  -XMLFileReporter::logCheckPass(const string& comment)
  +XMLFileReporter::logCheckPass(const XalanDOMString& comment)
   {
       if (isReady())
       {
  @@ -332,7 +349,7 @@
   
   
   void 
  -XMLFileReporter::logCheckAmbiguous(const string& comment)
  +XMLFileReporter::logCheckAmbiguous(const XalanDOMString& comment)
   {
       if (isReady())
       {
  @@ -343,7 +360,7 @@
   
   
   void 
  -XMLFileReporter::logCheckFail(const string& comment)
  +XMLFileReporter::logCheckFail(const XalanDOMString& comment)
   {
       if (isReady())
       {
  @@ -354,7 +371,7 @@
   
   
   void 
  -XMLFileReporter::logCheckErr(const string& comment)
  +XMLFileReporter::logCheckErr(const XalanDOMString& comment)
   {
       if (isReady())
       {
  @@ -363,32 +380,55 @@
   }
   
   
  +static const XalanDOMChar	theLessThanString[] =
  +{
  +	XalanUnicode::charAmpersand,
  +	XalanUnicode::charLetter_l,
  +	XalanUnicode::charLetter_t,
  +	XalanUnicode::charSemicolon,
  +	0
  +};
  +
   
  -string 
  -XMLFileReporter::escapestring(const string&  s)
  +static const XalanDOMChar	theGreaterThanString[] =
   {
  -    string sb;
  -    const int length = s.length();
  +	XalanUnicode::charAmpersand,
  +	XalanUnicode::charLetter_g,
  +	XalanUnicode::charLetter_t,
  +	XalanUnicode::charSemicolon,
  +	0
  +};
  +
   
  -    for (int i = 0; i < length; i++)
  +
  +XalanDOMString
  +XMLFileReporter::escapestring(const XalanDOMString&  s)
  +{
  +    XalanDOMString		sb;
  +
  +    const unsigned int	length = s.length();
  +
  +    for (unsigned int i = 0; i < length; i++)
       {
  -        char ch = s.at(i);
  -        if ('<' == ch)
  +        const XalanDOMChar	ch = charAt(s, i);
  +
  +        if (XalanUnicode::charLessThanSign == ch)
           {
  -            sb.append("&lt;");
  +			append(sb, theLessThanString);
           }
  -        else if ('>' == ch)
  +        else if (XalanUnicode::charGreaterThanSign == ch)
           {
  -            sb.append("&gt;");
  +			append(sb, theGreaterThanString);
           }
           // Note: Skipping escaping of UTF-16 surrogates and & ampersands, since 
           //  I don't think we'll be outputting them or they won't affect our output
           else
           {
  -            sb += ch;
  +            append(sb, ch);
           }
       }
  -    return sb;
  +
  +	return sb;
   }
   
   
  @@ -399,13 +439,17 @@
       if (isReady())
       {
           // Write out XML header and root test result element
  -        printToFile("<?xml version=\"1.0\"?>");
  +        printToFile(XalanDOMString("<?xml version=\"1.0\"?>"));
  +
           // Note: this tag is closed in our .close() method, which the caller had better call!
           printToFile("<" + ELEM_RESULTSFILE + " " + ATTR_FILENAME + "=\"" + m_fileName + "\">");
  +
           return true;
       }
       else
  +	{
           return false;
  +	}
   }
   
   
  @@ -424,11 +468,11 @@
   
   
   bool 
  -XMLFileReporter::printToFile(const string& output) 
  +XMLFileReporter::printToFile(const XalanDOMString&	output) 
   {
       if (isReady())
       {
  -        fprintf(m_fileHandle, output.c_str());
  +        fprintf(m_fileHandle, &output.transcode().front());
   		fprintf(m_fileHandle, "\n");
           return true;
       }
  @@ -438,17 +482,16 @@
   
   
   
  -string 
  +XalanDOMString 
   XMLFileReporter::getDateTimeString() 
   {
   	struct tm *tmNow;
   	time_t time_tNow;
  -	string dateTimeString;
   
   	time(&time_tNow);     
  -	tmNow = localtime(&time_tNow);  							
  -	dateTimeString = asctime(tmNow); 
  -	dateTimeString.replace(dateTimeString.length()-1, 1, "");
  +	tmNow = localtime(&time_tNow);
  +	
  +	const char* const	theTime = asctime(tmNow);
   
  -	return dateTimeString;       
  +	return XalanDOMString(theTime, strlen(theTime) - 1);
   }
  
  
  
  1.2       +95 -65    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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XMLFileReporter.hpp	2000/11/16 15:19:45	1.1
  +++ XMLFileReporter.hpp	2001/02/07 15:37:14	1.2
  @@ -54,26 +54,22 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    *
  - * XMLFileReporter.java
  + * XMLFileReporter.hpp
    */
   #if !defined(HARNESS_HEADER_GUARD_1357924680)
   #define HARNESS_HEADER_GUARD_1357924680
   
  -
  -#include<string>
   #include<stdio.h>
   #include <time.h>
  -
  -
   
  -using namespace std;
  +//#include <util/PlatformUtils.hpp>
  +#include <PlatformSupport/DOMStringHelper.hpp>
   
   
  -
   /**
    * Reporter that saves output to a simple XML-format file.  
    * @author Shane_Curcuru@lotus.com
  - * @version $Id: XMLFileReporter.hpp,v 1.1 2000/11/16 15:19:45 pauldick Exp $
  + * @version $Id: XMLFileReporter.hpp,v 1.2 2001/02/07 15:37:14 pauldick Exp $
    */
   
   #if defined HARNESS_EXPORTS
  @@ -93,8 +89,11 @@
   	XMLFileReporter();   
   
   
  +	/** Construct and initialize this reporter with specified filename.  */
  +	XMLFileReporter(const XalanDOMString& fileName);
  +
   	/** Construct and initialize this reporter with specified filename.  */
  -	XMLFileReporter(const string& fileName);
  +	XMLFileReporter::XMLFileReporter(const char* fileName);
   
   	/** Initialize this XMLFileReporter.  Must be called before attempting to log anything.  */
   	bool initialize();
  @@ -103,19 +102,25 @@
   	bool getFlushOnCaseClose();
   
   	/** Accessor methods for our properties block.  */
  -	const string& getFileName() const;
  +	const XalanDOMString& getFileName() const;
   
   	/** Accessor methods for our properties block.  */
  -	void setFileName(const string& fileName);
  +	void setFileName(const XalanDOMString& fileName);
   
  +	/** Accessor methods for our properties block.  */
  +	void setFileName(const char* fileName)
  +	{
  +		setFileName(XalanDOMString(fileName));
  +	}
  +
   	/**
   	* Is this Reporter still running OK?  
   	* @returns status - true if an error has occoured, false if it's still working fine
   	* <P>XMLFileReporter should just about never have errors.</P>
   	*/
   	bool checkError();
  -
   
  +	  
   	/**
   	* Is this Reporter ready to log results?  
   	* @returns status - true if it's ready to report, false otherwise
  @@ -137,24 +142,43 @@
   	* Report that a testfile has started.  
   	* @param msg message to log out
   	*/
  -	void logTestFileInit(const string& msg);
  +	void logTestFileInit(const XalanDOMString& msg);
   
  +	void logTestFileInit(const char*	msg)
  +	{
  +		logTestFileInit(XalanDOMString(msg));
  +	}
  +
   	/**
   	* Report that a testfile has finished, and report it's result.  
   	* @param msg message to log out
   	* @param result result of testfile
   	*/
  -	void logTestFileClose(const string& msg, const string& result);
  +	void logTestFileClose(const XalanDOMString& msg, const XalanDOMString& result);
   
  -	void logTestCaseInit(const string& msg);
  +	void logTestFileClose(const char* msg, const char* result)
  +	{
  +		logTestFileClose(XalanDOMString(msg), XalanDOMString(result));	
  +	}
  +
  +	void logTestCaseInit(const XalanDOMString& msg);
  +
  +	void logTestCaseInit(const char*	msg)
  +	{
  +		logTestCaseInit(XalanDOMString(msg));
  +	}
   
   	/**
   	* Report that a testcase has finished, and report it's result.  
   	* @param msg message to log out
   	* @param result result of testfile
   	*/
  -	void logTestCaseClose(const string& msg, const string& result);
  +	void logTestCaseClose(const XalanDOMString& msg, const XalanDOMString& result);
   
  +	void logTestCaseClose(const char* msg, const char* result)
  +	{
  +		logTestCaseClose(XalanDOMString(msg), XalanDOMString(result));
  +	}
   	//-----------------------------------------------------
   	//-------- Test results reporting and logging routines --------
   	//-----------------------------------------------------
  @@ -166,7 +190,7 @@
   	* @param level severity or class of message.
   	* @param msg comment to log out.
   	*/
  -	void logMessage(int level, const string& msg);
  +	void logMessage(int level, const XalanDOMString& msg);
   
   	/**
   	* Logs out statistics to result file with specified severity.  
  @@ -176,10 +200,15 @@
   	* @param dVal statistic in double format.
   	* @param msg comment to log out.
   	*/
  -	void logStatistic (int level, long lVal, double dVal, const string& msg);
  +	void logStatistic (int level, long lVal, double dVal, const XalanDOMString& msg);
  +
  +	void logStatistic (int level, long lVal, double dVal, const char*	msg)
  +	{
  +		logStatistic(level, lVal, dVal, XalanDOMString(msg));
  +	}
   
   	/**
  -	* Report an arbitrary string to result file with specified severity.  
  +	* Report an arbitrary XalanDOMString to result file with specified severity.  
   	* <P>Appends and prepends \\n newline characters at the start and 
   	* end of the message to separate it from the tags.</P>
   	* <P>Record format: &lt;arbitrary level="##"&gt;<BR/>
  @@ -187,9 +216,9 @@
   	* &lt;/arbitrary&gt;
   	* </P>
   	* @param level severity or class of message.
  -	* @param msg arbitrary string to log out.
  +	* @param msg arbitrary XalanDOMString to log out.
   	*/
  -	void logArbitraryMessage (int level, const string& msg);
  +	void logArbitraryMessage (int level, const XalanDOMString& msg);
   
   	/**
   	* Report a complete Hashtable to result file with specified severity.  
  @@ -204,7 +233,7 @@
   	* @param msg decription of the Hashtable.
   	*/
   	/*
  -	void logHashtable (int level, Hashtable hash, const string& msg);
  +	void logHashtable (int level, Hashtable hash, const XalanDOMString& msg);
   	*/
   
   	/**
  @@ -212,36 +241,37 @@
   	* <P>Record format: &lt;checkresult result="PASS" desc="comment"/&gt;</P>
   	* @param comment comment to log with the pass record.
   	*/
  -	void logCheckPass(const string& comment);
  +	void logCheckPass(const XalanDOMString& comment);
   
   	/**
   	* Writes out an ambiguous record with comment.  
   	* <P>Record format: &lt;checkresult result="AMBG" desc="comment"/&gt;</P>
   	* @param comment comment to log with the ambg record.
   	*/
  -	void logCheckAmbiguous(const string& comment);
  +	void logCheckAmbiguous(const XalanDOMString& comment);
   
   	/**
   	* Writes out a Fail record with comment.  
   	* <P>Record format: &lt;checkresult result="FAIL" desc="comment"/&gt;</P>
   	* @param comment comment to log with the fail record.
   	*/
  -	void logCheckFail(const string& comment);
  +	void logCheckFail(const XalanDOMString& comment);
   
   	/**
   	* Writes out a Error record with comment.  
   	* <P>Record format: &lt;checkresult result="ERRR" desc="comment"/&gt;</P>
   	* @param comment comment to log with the error record.
   	*/
  -	void logCheckErr(const string& comment);
  +	void logCheckErr(const XalanDOMString& comment);
   
   	/**
  -	* Escapes a string to remove < and > so it's valid XML.  
  +	* Escapes a XalanDOMString to remove < and > so it's valid XML.  
   	* <P>Stolen mostly from Xalan applet sample.</P>
  -	* @param s string to escape.
  -	* @return string that has been escaped.
  +	* @param s XalanDOMString to escape.
  +	* @return XalanDOMString that has been escaped.
   	*/
  -	string escapestring(const string& s);
  +	XalanDOMString escapestring(const XalanDOMString& s);
  +
   
   private:
   
  @@ -258,60 +288,60 @@
   	/**
   	* worker method to prints to the resultsfile.  
   	*/
  -	bool printToFile(const string& output);
  +	bool printToFile(const XalanDOMString& output);
   
   	/**
   	* worker method to prints to the resultsfile.  
   	*/
  -	string getDateTimeString();
  +	XalanDOMString getDateTimeString();
   	
   	/** Key for Properties block that denotes our output filename.  */
  -	static const string OPT_FILENAME;
  +	static const XalanDOMString OPT_FILENAME;
   
   	/** XML tagnames for results file structure.  */
  -	static const string ELEM_RESULTSFILE;
  -	static const string ELEM_TESTFILE;
  -	static const string ELEM_FILERESULT;
  -	static const string ELEM_TESTCASE;
  -	static const string ELEM_CASERESULT;
  -	static const string ELEM_CHECKRESULT;
  -	static const string ELEM_STATISTIC;
  -	static const string ELEM_LONGVAL;
  -	static const string ELEM_DOUBLEVAL;
  -	static const string ELEM_MESSAGE;
  -	static const string ELEM_ARBITRARY;
  -	static const string ELEM_HASHTABLE;
  -	static const string ELEM_HASHITEM;
  +	static const XalanDOMString ELEM_RESULTSFILE;
  +	static const XalanDOMString ELEM_TESTFILE;
  +	static const XalanDOMString ELEM_FILERESULT;
  +	static const XalanDOMString ELEM_TESTCASE;
  +	static const XalanDOMString ELEM_CASERESULT;
  +	static const XalanDOMString ELEM_CHECKRESULT;
  +	static const XalanDOMString ELEM_STATISTIC;
  +	static const XalanDOMString ELEM_LONGVAL;
  +	static const XalanDOMString ELEM_DOUBLEVAL;
  +	static const XalanDOMString ELEM_MESSAGE;
  +	static const XalanDOMString ELEM_ARBITRARY;
  +	static const XalanDOMString ELEM_HASHTABLE;
  +	static const XalanDOMString ELEM_HASHITEM;
   
   	/** XML attribute names for results file structure.  */
  -	static const string ATTR_LEVEL;
  -	static const string ATTR_DESC;
  -	static const string ATTR_TIME;
  -	static const string ATTR_RESULT;
  -	static const string ATTR_KEY;
  -	static const string ATTR_FILENAME;
  +	static const XalanDOMString ATTR_LEVEL;
  +	static const XalanDOMString ATTR_DESC;
  +	static const XalanDOMString ATTR_TIME;
  +	static const XalanDOMString ATTR_RESULT;
  +	static const XalanDOMString ATTR_KEY;
  +	static const XalanDOMString ATTR_FILENAME;
   
   	/** 
  -	* Optimization: for heavy use methods, form pre-defined constants to save on string concatenation.  
  +	* Optimization: for heavy use methods, form pre-defined constants to save on XalanDOMString concatenation.  
   	* <P>Note the indent; must be updated if we ever switch to another indenting method.</P>
   	*/
  -	static const string TESTCASEINIT_HDR;
  -	static const string TESTCASECLOSE_HDR;
  -	static const string MESSAGE_HDR;
  -	static const string STATISTIC_HDR;
  -	static const string ARBITRARY_HDR;
  -	static const string HASHTABLE_HDR;
  -	static const string HASHITEM_HDR;
  -	static const string CHECKPASS_HDR;
  -	static const string CHECKAMBG_HDR;
  -	static const string CHECKERRR_HDR;
  -	static const string CHECKFAIL_HDR;
  +	static const XalanDOMString TESTCASEINIT_HDR;
  +	static const XalanDOMString TESTCASECLOSE_HDR;
  +	static const XalanDOMString MESSAGE_HDR;
  +	static const XalanDOMString STATISTIC_HDR;
  +	static const XalanDOMString ARBITRARY_HDR;
  +	static const XalanDOMString HASHTABLE_HDR;
  +	static const XalanDOMString HASHITEM_HDR;
  +	static const XalanDOMString CHECKPASS_HDR;
  +	static const XalanDOMString CHECKAMBG_HDR;
  +	static const XalanDOMString CHECKERRR_HDR;
  +	static const XalanDOMString CHECKFAIL_HDR;
   
   	/** If we have output anything yet.  */
   	bool m_anyOutput;
   
   	/** Name of the file we're outputing to.  */
  -	string m_fileName;
  +	XalanDOMString m_fileName;
   
   	/** File reference and other internal convenience variables.  */
   	FILE* m_fileHandle;