diff options
author | Guto Maia <guto@guto.net> | 2011-03-22 10:49:25 -0300 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-03-23 10:04:31 +0000 |
commit | fa7d784704ce4513b7204d62ff0230209259574a (patch) | |
tree | fe4badbca06a4f6cd61373a3f35b0d384f80ded2 /writerfilter/qa | |
parent | df5782469ff01f9994449d398d1281bf77d8e0fe (diff) |
unnecessary test. Testing xxml itself
Diffstat (limited to 'writerfilter/qa')
-rw-r--r-- | writerfilter/qa/cppunittests/xxml/export.map | 34 | ||||
-rw-r--r-- | writerfilter/qa/cppunittests/xxml/makefile.mk | 75 | ||||
-rw-r--r-- | writerfilter/qa/cppunittests/xxml/test.xml | 2 | ||||
-rw-r--r-- | writerfilter/qa/cppunittests/xxml/testXXML.cxx | 181 |
4 files changed, 0 insertions, 292 deletions
diff --git a/writerfilter/qa/cppunittests/xxml/export.map b/writerfilter/qa/cppunittests/xxml/export.map deleted file mode 100644 index 7321bbca16ad..000000000000 --- a/writerfilter/qa/cppunittests/xxml/export.map +++ /dev/null @@ -1,34 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -UDK_3_0_0 { - global: - registerAllTestFunction; - - local: - *; -}; diff --git a/writerfilter/qa/cppunittests/xxml/makefile.mk b/writerfilter/qa/cppunittests/xxml/makefile.mk deleted file mode 100644 index fcce5dbec8dd..000000000000 --- a/writerfilter/qa/cppunittests/xxml/makefile.mk +++ /dev/null @@ -1,75 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* -PRJ=..$/..$/.. - -PRJNAME=writerfilter -TARGET=test-xxml - -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -CFLAGSCXX += $(CPPUNIT_CFLAGS) - -# BEGIN ---------------------------------------------------------------- -# auto generated Target:testjob by codegen.pl - -.IF "$(GUI)" == "WNT" - CFLAGS+=/Ob1 -.ENDIF - -SHL1OBJS=\ - $(SLO)$/testXXML.obj - -SHL1TARGET=$(TARGET) -SHL1STDLIBS=$(SALLIB) $(TOOLSLIB) $(CPPUNITLIB) - -.IF "$(GUI)" == "WNT" -SHL1STDLIBS+=$(LB)$/iodiapi.lib -.ENDIF -.IF "$(GUI)" == "UNX" -SHL1STDLIBS+=$(LB)$/libodiapi.so -.ENDIF - -SHL1IMPLIB= i$(SHL1TARGET) - -# SHL1DEF= $(MISC)$/$(SHL1TARGET).def - -DEF1NAME =$(SHL1TARGET) - -# DEF1EXPORTFILE= export.exp -SHL1VERSIONMAP = export.map - - -# END ------------------------------------------------------------------ - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk -.INCLUDE : _cppunit.mk diff --git a/writerfilter/qa/cppunittests/xxml/test.xml b/writerfilter/qa/cppunittests/xxml/test.xml deleted file mode 100644 index 74e5fbd82d2f..000000000000 --- a/writerfilter/qa/cppunittests/xxml/test.xml +++ /dev/null @@ -1,2 +0,0 @@ -<?xml version="1.0"?> -<test xmlns="http://sample.org/test" xmlns:tst="http://sample.org/test" v1="a" tst:v2="b">HALLO</test> diff --git a/writerfilter/qa/cppunittests/xxml/testXXML.cxx b/writerfilter/qa/cppunittests/xxml/testXXML.cxx deleted file mode 100644 index 8a78e3a4dd74..000000000000 --- a/writerfilter/qa/cppunittests/xxml/testXXML.cxx +++ /dev/null @@ -1,181 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include <testshl/simpleheader.hxx> -#include <odiapi/xxml/XXmlReader.hxx> -#include <osl/time.h> - - -using namespace writerfilter; - -class Node -{ -public: - QName_t tag; - Node *next; - Node *prev; - - Node(QName_t tag) : prev(NULL), next(NULL), tag(tag) { - }; - - void append(Node &node) - { - this->next=&node; - node.prev=this; - } -}; - -class Table : public Node -{ -public: - Table(QName_t tag):Node(tag) {}; -}; - -class Row : public Node -{ -public: - Table &parent; - - Row(QName_t tag, Table &parent) : Node(tag), parent(parent) {}; -}; - -class Cell : public Node -{ -public: - Row &parent; - - Cell(QName_t tag, Row &parent) : Node(tag), parent(parent) {}; -}; - - -class MyHandler : public xxml::ContentHandler -{ -public: - int events; - Table *currentTable; - Row *currentRow; - Cell *currentCell; - - virtual void startDocument() - { - currentTable=NULL; - currentRow=NULL; - currentCell=NULL; - events=1; - } - virtual void endDocument() - { - events++; - } - virtual void startElement(QName_t name, QName_t attrName[], const xxml::Value *attrValue[], int attrs) - { - events++; - for(int i=0;i<attrs;i++) - { - events++; - } - - switch(name) - { - case NS_table::LN_table: - case NS_ss11::LN_Table: - currentTable=new Table(name); - break; - case NS_table::LN_table_row: - case NS_ss11::LN_Row: - if (currentRow==NULL) - currentRow=new Row(name, *currentTable); - else - currentRow->append(*new Row(name, *currentTable)); - break; - case NS_table::LN_table_cell: - case NS_ss11::LN_Cell: - if (currentCell==NULL) - currentCell=new Cell(name, *currentRow); - else - currentCell->append(*new Cell(name, *currentRow)); - break; - - }; - - } - virtual void endElement(QName_t name) - { - events++; - switch(name) - { - case NS_table::LN_table: - case NS_ss11::LN_Table: - currentRow->append(*currentTable); - currentRow=NULL; - break; - case NS_table::LN_table_row: - case NS_ss11::LN_Row: - currentCell->append(*currentRow); - currentCell=NULL; - break; - case NS_table::LN_table_cell: - case NS_ss11::LN_Cell: - break; - - }; - } - virtual void characters(const xxml::Value &value) - { - events++; - } - -}; - -class TestXXML : public CppUnit::TestFixture -{ -public: - void test() - { - MyHandler handler; - std::auto_ptr<xxml::XXmlReader> reader=xxml::XXmlReader::createXXmlReader(handler); - TimeValue t1; osl_getSystemTime(&t1); - - reader->read("C:\\Documents and Settings\\fr156068\\My Documents\\odt\\testfile\\content.xml"); - TimeValue t2; osl_getSystemTime(&t2); - printf("Events=%i time=%is time/event=%0.10fs\n", handler.events, t2.Seconds-t1.Seconds, (double)(t2.Seconds-t1.Seconds)/(double)handler.events); - } - - CPPUNIT_TEST_SUITE(TestXXML); - CPPUNIT_TEST(test); - - - CPPUNIT_TEST_SUITE_END(); -}; - -//##################################### -// register test suites -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(TestXXML, "TestXXML"); - -NOADDITIONAL; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |