pauldick    01/09/14 14:00:32

  Modified:    c/Tests/Harness XMLFileReporter.hpp XMLFileReporter.cpp
  Log:
  Numerous changes.
  
  Revision  Changes    Path
  1.6       +12 -4     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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- XMLFileReporter.hpp       2001/05/17 18:30:26     1.5
  +++ XMLFileReporter.hpp       2001/09/14 21:00:32     1.6
  @@ -70,7 +70,7 @@
   /**
    * Reporter that saves output to a simple XML-format file.  
    * @author [EMAIL PROTECTED]
  - * @version $Id: XMLFileReporter.hpp,v 1.5 2001/05/17 18:30:26 pauldick Exp $
  + * @version $Id: XMLFileReporter.hpp,v 1.6 2001/09/14 21:00:32 pauldick Exp $
    */
   
   #if defined HARNESS_EXPORTS
  @@ -229,13 +229,16 @@
       * caller must ensure they're legal XML
        * @param msg comment to log out.
        */
  -     void logElement(int level, const XalanDOMString& element, Hashtable attrs, 
const XalanDOMString& msg);
  +     void logElementWAttrs(int level, const XalanDOMString& element, Hashtable 
attrs, const XalanDOMString& msg);
   
  -     void logElement(int level,  const char* element, Hashtable attrs, const char* 
msg)
  +     void logElementWAttrs(int level,  const char* element, Hashtable attrs, const 
char* msg)
        {
  -             logElement(level, XalanDOMString(element), attrs, XalanDOMString(msg));
  +             logElementWAttrs(level, XalanDOMString(element), attrs, 
XalanDOMString(msg));
        }
   
  +     void logElement(int level, const XalanDOMString& element, const 
XalanDOMString& msg);
  +
  +     void XMLFileReporter::logElement(const XalanDOMString& element, const 
XalanDOMString& msg);
        /**
        * Report an arbitrary XalanDOMString to result file with specified severity.  
        * <P>Appends and prepends \\n newline characters at the start and 
  @@ -286,6 +289,10 @@
        */
        void logCheckFail(const XalanDOMString& comment);
   
  +     void logCheckFail(const XalanDOMString& test, Hashtable faildata, Hashtable 
actexp);
  +
  +     void logErrorResult(const XalanDOMString& test, const XalanDOMString& reason);
  +
        /**
        * Writes out a Error record with comment.  
        * <P>Record format: &lt;checkresult result="ERRR" desc="comment"/&gt;</P>
  @@ -365,6 +372,7 @@
        static const XalanDOMString CHECKAMBG_HDR;
        static const XalanDOMString CHECKERRR_HDR;
        static const XalanDOMString CHECKFAIL_HDR;
  +     static const XalanDOMString CHECKFAIL_FTR;
   
        /** If we have output anything yet.  */
        bool m_anyOutput;
  
  
  
  1.8       +61 -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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XMLFileReporter.cpp       2001/05/17 18:31:38     1.7
  +++ XMLFileReporter.cpp       2001/09/14 21:00:32     1.8
  @@ -18,9 +18,9 @@
   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_TESTCASE("Test_Dir");
  +const XalanDOMString  XMLFileReporter::ELEM_CASERESULT("Dir-result");
  +const XalanDOMString  XMLFileReporter::ELEM_CHECKRESULT("Testcase");
   const XalanDOMString  XMLFileReporter::ELEM_STATISTIC("statistic");
   const XalanDOMString  XMLFileReporter::ELEM_LONGVAL("longval");
   const XalanDOMString  XMLFileReporter::ELEM_DOUBLEVAL("doubleval");
  @@ -41,14 +41,14 @@
   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::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 + "=\"");
  +const XalanDOMString XMLFileReporter::CHECKFAIL_FTR("</" + ELEM_CHECKRESULT + ">");
   
   
  -
   XMLFileReporter::XMLFileReporter():
        m_anyOutput(false),
        m_fileName(""),
  @@ -217,8 +217,8 @@
   {
       if (isReady())
       {
  -        printToFile("<" + ELEM_FILERESULT 
  -                              + " " + ATTR_DESC + "=\"" + escapestring(msg) + "\" " 
+ ATTR_RESULT + "=\"" + result + "\" " + ATTR_TIME + "=\"" + getDateTimeString() + 
"\"/>");
  +//        printToFile("<" + ELEM_FILERESULT 
  +//                             + " " + ATTR_DESC + "=\"" + escapestring(msg) + "\" 
" + ATTR_RESULT + "=\"" + result + "\" " + ATTR_TIME + "=\"" + getDateTimeString() + 
"\"/>");
           printToFile("</" + ELEM_TESTFILE + ">");
       }
       flush();
  @@ -242,7 +242,7 @@
   {
       if (isReady())
       {
  -        printToFile(TESTCASECLOSE_HDR + escapestring(msg) + "\" " + ATTR_RESULT + 
"=\"" + result + "\"/>");
  +        //printToFile(TESTCASECLOSE_HDR + escapestring(msg) + "\" " + ATTR_RESULT + 
"=\"" + result + "\"/>");
           printToFile("</" + ELEM_TESTCASE + ">");
       }
       if (getFlushOnCaseClose())
  @@ -278,7 +278,7 @@
   }
   
   void 
  -XMLFileReporter::logElement(int level, const XalanDOMString& element, Hashtable 
attrs,const XalanDOMString& msg)
  +XMLFileReporter::logElementWAttrs(int level, const XalanDOMString& element, 
Hashtable attrs, const XalanDOMString& msg)
   {
        if (isReady()
           && (element.empty() == 0)
  @@ -309,7 +309,23 @@
       }
   }
   
  +void 
  +XMLFileReporter::logElement(const XalanDOMString& element, const XalanDOMString& 
msg)
  +{
  +     if (isReady()
  +        && (element.empty() == 0)
  +        && (msg.empty() == 0)
  +       )
  +    {
   
  +        printToFile("<" + escapestring(element) + ">");
  +
  +        if (msg.empty() == 0)
  +            //printToFile(escapestring(msg));
  +                     printToFile(msg);
  +        printToFile("</" + escapestring(element) + ">");
  +    }
  +}
   
   void 
   XMLFileReporter::logStatistic (int level, long lVal, double dVal, const 
XalanDOMString& msg)
  @@ -411,10 +427,46 @@
       if (isReady())
       {
           printToFile(CHECKFAIL_HDR + escapestring(comment) + "\"/>");
  +
  +    }
  +}
  +
  +
  +void 
  +XMLFileReporter::logErrorResult(const XalanDOMString& test, const XalanDOMString& 
reason)
  +{
  +    if (isReady())
  +    {
  +        printToFile(CHECKFAIL_HDR + escapestring(test) + "\" " + 
XalanDOMString("reason=\"") + escapestring(reason)  + "\"/>");
  +
       }
   }
   
  +void 
  +XMLFileReporter::logCheckFail(const XalanDOMString& test, Hashtable attrs, 
Hashtable actexp)
  +{
  +    if (isReady())
  +    {
  +        printToFile(CHECKFAIL_HDR + escapestring(test) + "\"");
  +
  +             Hashtable::iterator fdEnd = attrs.end();        
  +             for(Hashtable::iterator i = attrs.begin(); i != fdEnd; ++i)
  +        {            
  +            printToFile((*i).first + "=\""
  +                                  + (*i).second + "\"");
  +        }
  +
  +             printToFile(XalanDOMString(">"));
  +             
  +             Hashtable::iterator aeEnd = actexp.end();
  +             for(Hashtable::iterator ii = actexp.begin(); ii != aeEnd; ++ii)
  +        {            
  +                     logElement((*ii).first, (*ii).second);
  +        }
   
  +             printToFile(CHECKFAIL_FTR);
  +    }
  +}
   
   void 
   XMLFileReporter::logCheckErr(const XalanDOMString& comment)
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to