pauldick    01/09/20 08:32:53

  Modified:    c/Tests/Harness FileUtility.cpp
  Log:
  Fixed bug in file compare, it was comparing chars beyond the
  designated buffers.  Removed some debug spew as well.
  
  Revision  Changes    Path
  1.15      +18 -17    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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- FileUtility.cpp   2001/09/19 17:17:44     1.14
  +++ FileUtility.cpp   2001/09/20 15:32:53     1.15
  @@ -408,7 +408,8 @@
                                                const char* outputFile)
   {
        FILE *result, *gold;                    // declare files
  -     char rline[132], gline[132];    // declare buffers to hold single line from 
file
  +     char rline[132] = {'/n'};               // declare buffers to hold single line 
from file
  +     char gline[132] = {'/n'};       
        char temp[10];                                  // buffer to hold line number
        char lineNum = 1;
   
  @@ -441,7 +442,7 @@
                }
   
                int i = 0;
  -             while(gline[i] != '\n') 
  +             while(i < sizeof(gline)) 
                {
                        if (gline[i] == rline[i]) 
                        {
  @@ -514,9 +515,9 @@
        case XalanNode::TEXT_NODE:      
        {
   
  -#if !defined(NDEBUG) && defined(_MSC_VER)
  -             cout << "Node is: " << c_str(TranscodeToLocalCodePage(docNodeValue)) 
<< endl;
  -#endif
  +//#if !defined(NDEBUG) && defined(_MSC_VER)
  +//           cout << "Node is: " << c_str(TranscodeToLocalCodePage(docNodeValue)) 
<< endl;
  +//#endif
                
                if(goldNodeValue != docNodeValue)
                {
  @@ -563,9 +564,9 @@
        case XalanNode::DOCUMENT_NODE:
        {
   
  -#if !defined(NDEBUG) && defined(_MSC_VER)
  -             cout << "Node is: " << c_str(TranscodeToLocalCodePage(docNodeName)) << 
endl;
  -#endif
  +//#if !defined(NDEBUG) && defined(_MSC_VER)
  +//           cout << "Node is: " << c_str(TranscodeToLocalCodePage(docNodeName)) << 
endl;
  +//#endif
                // We should never reach this code path.  The parser should flag the 
fact that there
                // is no Document_Node.
                if (goldNodeName != docNodeName)  
  @@ -624,9 +625,9 @@
        const XalanDOMString&  docNsUri  = doc.getNamespaceURI();
        const XalanDOMString&  goldNsUri = gold.getNamespaceURI();
   
  -#if !defined(NDEBUG) && defined(_MSC_VER)
  -     cout << "Node is: " << c_str(TranscodeToLocalCodePage(docNodeName)) << endl;
  -#endif
  +//#if !defined(NDEBUG) && defined(_MSC_VER)
  +//   cout << "Node is: " << c_str(TranscodeToLocalCodePage(docNodeName)) << endl;
  +//#endif
   
        // This essentially checks 2 things, that the prefix and localname are the
        // same.  So specific checks of these items are not necessary.
  @@ -808,10 +809,10 @@
   
        const XalanDOMString& docAttrName  = dAttr->getNodeName();
   
  -#if !defined(NDEBUG) && defined(_MSC_VER)
  -     const XalanDOMString& goldAttrName = gAttr->getNodeName();
  -     cout << "       Attribute is: " << 
c_str(TranscodeToLocalCodePage(goldAttrName)) << endl;
  -#endif
  +//#if !defined(NDEBUG) && defined(_MSC_VER)
  +//   const XalanDOMString& goldAttrName = gAttr->getNodeName();
  +//   cout << "       Attribute is: " << 
c_str(TranscodeToLocalCodePage(goldAttrName)) << endl;
  +//#endif
   
        const XalanDOMString& goldAttrNsUri = gAttr->getNamespaceURI();
        const XalanDOMString& docAttrNsUri      = dAttr->getNamespaceURI();
  @@ -854,8 +855,8 @@
        cout << endl << "* Failed "<< data.testOrFile 
                 << "  " << data.msg << endl
                 << "   " << "Processing Node: " << data.currentNode << endl
  -              << "   Expected: " << data.expected << endl
  -              << "   Actual: " << data.actual << endl;
  +              << "   Expected:       " << data.expected << endl
  +              << "   Actual:         " << data.actual << endl;
   
   }
   
  
  
  

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

Reply via email to