You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by tn...@apache.org on 2002/05/21 20:54:16 UTC

cvs commit: xml-xerces/c/tests/InitTermTest InitTermTest.cpp

tng         02/05/21 11:54:16

  Modified:    c/tests/InitTermTest InitTermTest.cpp
  Log:
  Test case update: modify to use the latest DOM interface.
  
  Revision  Changes    Path
  1.5       +6 -34     xml-xerces/c/tests/InitTermTest/InitTermTest.cpp
  
  Index: InitTermTest.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/tests/InitTermTest/InitTermTest.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- InitTermTest.cpp	17 Apr 2002 20:18:08 -0000	1.4
  +++ InitTermTest.cpp	21 May 2002 18:54:16 -0000	1.5
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: InitTermTest.cpp,v 1.4 2002/04/17 20:18:08 tng Exp $
  + * $Id: InitTermTest.cpp,v 1.5 2002/05/21 18:54:16 tng Exp $
    */
   
   // ---------------------------------------------------------------------------
  @@ -70,14 +70,12 @@
   #include <xercesc/sax/SAXException.hpp>
   #include <xercesc/sax/SAXParseException.hpp>
   
  -#include <xercesc/parsers/DOMParser.hpp>
  -#include <xercesc/parsers/IDOMParser.hpp>
  +#include <xercesc/parsers/XercesDOMParser.hpp>
   #include <xercesc/parsers/SAXParser.hpp>
   #include <xercesc/sax2/SAX2XMLReader.hpp>
   #include <xercesc/sax2/XMLReaderFactory.hpp>
   
  -#include <xercesc/dom/DOM_DOMException.hpp>
  -#include <xercesc/idom/IDOM_DOMException.hpp>
  +#include <xercesc/dom/DOMException.hpp>
   #include "InitTermTest.hpp"
   
   #include <string.h>
  @@ -101,7 +99,6 @@
   //  Declare functions
   // ---------------------------------------------------------------------------
   int TestInit4DOM(const char* xmlFile, bool gDoNamespaces, bool gDoSchema, bool gSchemaFullChecking, Teststate theState);
  -int TestInit4DOM(const char* xmlFile, bool gDoNamespaces, bool gDoSchema, bool gSchemaFullChecking, Teststate theState);
   int TestInit4SAX(const char* xmlFile, bool gDoNamespaces, bool gDoSchema, bool gSchemaFullChecking, Teststate theState);
   int TestInit4SAX2(const char* xmlFile, bool gDoNamespaces, bool gDoSchema, bool gSchemaFullChecking, Teststate theState);
   
  @@ -172,7 +169,7 @@
                << StrX(toCatch.getMessage()) << "\n" << endl;       \
           errorOccurred = true;                                     \
       }                                                             \
  -    catch (const DOM_DOMException& toCatch)                       \
  +    catch (const DOMException& toCatch)                           \
       {                                                             \
           cerr << "\nDOM Error during parsing: '" << xmlFile        \
                << "\nDOMException code is:  \n"                     \
  @@ -213,20 +210,7 @@
   int TestInit4DOM(const char* xmlFile, bool gDoNamespaces, bool gDoSchema, bool gSchemaFullChecking, Teststate theState)
   {
       TESTINITPRE;
  -    DOMParser* parser = new DOMParser;
  -    parser->setDoNamespaces(gDoNamespaces);
  -    parser->setDoSchema(gDoSchema);
  -    parser->setValidationSchemaFullChecking(gSchemaFullChecking);
  -    TESTINITPOST;
  -}
  -
  -// ---------------------------------------------------------------------------
  -//  IDOM Parser
  -// ---------------------------------------------------------------------------
  -int TestInit4IDOM(const char* xmlFile, bool gDoNamespaces, bool gDoSchema, bool gSchemaFullChecking, Teststate theState)
  -{
  -    TESTINITPRE;
  -    IDOMParser* parser = new IDOMParser;
  +    XercesDOMParser* parser = new XercesDOMParser;
       parser->setDoNamespaces(gDoNamespaces);
       parser->setDoSchema(gDoSchema);
       parser->setValidationSchemaFullChecking(gSchemaFullChecking);
  @@ -280,9 +264,7 @@
       cout << "\nUsage:\n"
               "    InitTermTest [options] <XML file>\n\n"
               "This program tests the XMLPlatformUtils::Initialize()/Terminate()\n"
  -            "pair by calling it a number of times.  All four parsers\n"
  -            "(DOMParser, IDOMParser, SAXParser and SAX2XMLReader) are invoked\n"
  -            "to parse the specified XML file.\n\n"
  +            "pair by calling it a number of times.\n"
               "Options:\n"
               "    -n          Enable namespace processing. Default is off.\n"
               "    -s          Enable schema processing. Default is off.\n"
  @@ -381,8 +363,6 @@
   
           if (TestInit4DOM(xmlFile, gDoNamespaces, gDoSchema, gSchemaFullChecking, Once))
               error = true;
  -        if (TestInit4IDOM(xmlFile, gDoNamespaces, gDoSchema, gSchemaFullChecking, Once))
  -            error = true;
           if (TestInit4SAX(xmlFile, gDoNamespaces, gDoSchema, gSchemaFullChecking, Once))
               error = true;
           if (TestInit4SAX2(xmlFile, gDoNamespaces, gDoSchema, gSchemaFullChecking, Once))
  @@ -391,8 +371,6 @@
   
       if (error || TestInit4DOM(xmlFile, gDoNamespaces, gDoSchema, gSchemaFullChecking, Multiple))
           error = true;
  -    if (error || TestInit4IDOM(xmlFile, gDoNamespaces, gDoSchema, gSchemaFullChecking, Multiple))
  -        error = true;
       if (error || TestInit4SAX(xmlFile, gDoNamespaces, gDoSchema, gSchemaFullChecking, Multiple))
           error = true;
       if (error || TestInit4SAX2(xmlFile, gDoNamespaces, gDoSchema, gSchemaFullChecking, Multiple))
  @@ -404,8 +382,6 @@
   /*
       if (error || TestInit4DOM(xmlFile, gDoNamespaces, gDoSchema, gSchemaFullChecking, Limit))
           error = true;
  -    if (error || TestInit4IDOM(xmlFile, gDoNamespaces, gDoSchema, gSchemaFullChecking, Limit))
  -        error = true;
       if (error || TestInit4SAX(xmlFile, gDoNamespaces, gDoSchema, gSchemaFullChecking, Limit))
           error = true;
       if (error || TestInit4SAX2(xmlFile, gDoNamespaces, gDoSchema, gSchemaFullChecking, Limit))
  @@ -413,8 +389,6 @@
   
       if (error || TestInit4DOM(xmlFile, gDoNamespaces, gDoSchema, gSchemaFullChecking, ExceedLimit))
           error = true;
  -    if (error || TestInit4IDOM(xmlFile, gDoNamespaces, gDoSchema, gSchemaFullChecking, ExceedLimit))
  -        error = true;
       if (error || TestInit4SAX(xmlFile, gDoNamespaces, gDoSchema, gSchemaFullChecking, ExceedLimit))
           error = true;
       if (error || TestInit4SAX2(xmlFile, gDoNamespaces, gDoSchema, gSchemaFullChecking, ExceedLimit))
  @@ -422,8 +396,6 @@
   */
   
       if (error || TestInit4DOM(xmlFile, gDoNamespaces, gDoSchema, gSchemaFullChecking, UnEven))
  -        error = true;
  -    if (error || TestInit4IDOM(xmlFile, gDoNamespaces, gDoSchema, gSchemaFullChecking, UnEven))
           error = true;
       if (error || TestInit4SAX(xmlFile, gDoNamespaces, gDoSchema, gSchemaFullChecking, UnEven))
           error = true;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org