summaryrefslogtreecommitdiff
path: root/writerfilter/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-09-23 16:59:51 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-09-23 17:08:04 +0200
commitd3c70e68c652bbdeeaea20200e003b6c5f92a62f (patch)
tree77fe6c2903fca5f9920e7873a91fbf81030bcbf2 /writerfilter/qa
parentf236dd2916f487e52853bedd1688448f128fe3ab (diff)
writerfilter: remove dead doctok unit test
Change-Id: I4d223611df92a7e348dc31e38bd45849fe0eb028
Diffstat (limited to 'writerfilter/qa')
-rw-r--r--writerfilter/qa/cppunittests/doctok/doctok.job1
-rw-r--r--writerfilter/qa/cppunittests/doctok/export.map25
-rw-r--r--writerfilter/qa/cppunittests/doctok/testdoctok.cxx238
3 files changed, 0 insertions, 264 deletions
diff --git a/writerfilter/qa/cppunittests/doctok/doctok.job b/writerfilter/qa/cppunittests/doctok/doctok.job
deleted file mode 100644
index c99341dd55d9..000000000000
--- a/writerfilter/qa/cppunittests/doctok/doctok.job
+++ /dev/null
@@ -1 +0,0 @@
-doctok.test.openFile \ No newline at end of file
diff --git a/writerfilter/qa/cppunittests/doctok/export.map b/writerfilter/qa/cppunittests/doctok/export.map
deleted file mode 100644
index 06b6a4a9286b..000000000000
--- a/writerfilter/qa/cppunittests/doctok/export.map
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-
-UDK_3_0_0 {
- global:
- registerAllTestFunction;
-
- local:
- *;
-};
diff --git a/writerfilter/qa/cppunittests/doctok/testdoctok.cxx b/writerfilter/qa/cppunittests/doctok/testdoctok.cxx
deleted file mode 100644
index e4a04f7fe1dd..000000000000
--- a/writerfilter/qa/cppunittests/doctok/testdoctok.cxx
+++ /dev/null
@@ -1,238 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <sal/config.h>
-
-#include <osl/process.h>
-#include <ucbhelper/contentbroker.hxx>
-#include <ucbhelper/std_inputstream.hxx>
-#include <cppuhelper/bootstrap.hxx>
-#include "cppunit/TestAssert.h"
-#include "cppunit/TestFixture.h"
-#include "cppunit/extensions/HelperMacros.h"
-#include "cppunit/plugin/TestPlugIn.h"
-#include <com/sun/star/ucb/SimpleFileAccess.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/lang/XMultiComponentFactory.hpp>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/container/XNameContainer.hpp>
-
-#include <resourcemodel/exceptions.hxx>
-#include <doctok/WW8Document.hxx>
-#include <resourcemodel/WW8ResourceModel.hxx>
-
-#include <iostream>
-
-namespace testdoctok
-{
- using namespace ::std;
- using namespace ::writerfilter::doctok;
- using namespace ::com::sun::star;
-
- uno::Reference<io::XInputStream> xStream;
- uno::Reference<uno::XComponentContext> xContext;
- WW8Document::Pointer_t pDocument;
- uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess3 > xSimpleFileAccess;
-
- class test : public CppUnit::TestFixture
- {
-
- public:
- // initialise your test code values here.
- void setUp()
- {
- }
-
- void tearDown()
- {
- }
-
- void testInitUno()
- {
- bool bResult = false;
-
- // initialise UCB-Broker
- uno::Reference<uno::XComponentContext>
- xComponentContext
- (::cppu::defaultBootstrap_InitialComponentContext());
- OSL_ASSERT( xComponentContext.is() );
-
- xContext = xComponentContext;
-
- uno::Reference<lang::XMultiComponentFactory>
- xFactory(xComponentContext->getServiceManager() );
- OSL_ASSERT(xFactory.is());
-
- uno::Sequence<uno::Any> aUcbInitSequence(2);
- aUcbInitSequence[0] <<= OUString("Local");
- aUcbInitSequence[1] <<= OUString("Office");
-
- uno::Reference<lang::XMultiServiceFactory>
- xServiceFactory(xFactory, uno::UNO_QUERY);
- OSL_ASSERT( xServiceFactory.is() );
-
- if (xServiceFactory.is())
- {
- sal_Bool bRet =
- ::ucb::ContentBroker::initialize(xServiceFactory,
- aUcbInitSequence);
-
- OSL_ASSERT(bRet);
- if (bRet)
- {
- xSimpleFileAccess = ucb::SimpleFileAccess::create(xComponentContext);
- bResult = true;
- }
- }
-
- CPPUNIT_ASSERT_MESSAGE("UNO initialization failed",
- bResult);
- }
-
- // insert your test code here.
- void testOpenFile()
- {
- try
- {
- rtl_uString *dir=NULL;
- osl_getProcessWorkingDir(&dir);
- rtl_uString *fname=NULL;
- //rtl_uString_newFromAscii(&fname, "/OpenDocument-v1.doc");
- rtl_uString_newFromAscii(&fname, "/test.doc");
- //rtl_uString_newFromAscii(&fname, "/numbers.doc");
- rtl_uString *absfile=NULL;
- rtl_uString_newConcat(&absfile, dir, fname);
-
- OUString sInputFileURL( absfile );
-
- for (sal_uInt32 n = 0; n < sInputFileURL.getLength(); ++n)
- {
- sal_uChar nC = sInputFileURL[n];
-
- if (nC < 0xff && isprint(nC))
- clog << static_cast<char>(nC);
- else
- clog << ".";
- }
-
- clog << endl;
-
- xStream = xSimpleFileAccess->openFileRead(sInputFileURL);
-
- WW8Stream::Pointer_t pStream =
- WW8DocumentFactory::createStream(xContext, xStream);
-
- pDocument = WW8DocumentFactory::createDocument(pStream);
- }
- catch (writerfilter::Exception e)
- {
- clog << "Exception!!" << endl;
- }
-
- CPPUNIT_ASSERT_MESSAGE("creating document failed",
- pDocument != NULL);
-
-#if 1
- }
-
- void testTraversal()
- {
-#endif
- sal_uInt32 nResult = 0;
-
- try
- {
- WW8DocumentIterator::Pointer_t pIt = pDocument->begin();
- WW8DocumentIterator::Pointer_t pItEnd = pDocument->end();
-
- while (! pIt->equal(*pItEnd))
- {
- pIt->dump(clog);
-
- clog << endl;
-
- WW8PropertySet::Pointer_t pAttrs = pIt->getProperties();
-
- if (pAttrs != NULL)
- {
- pAttrs->dump(clog);
- }
-
- pIt->getText().dump(clog);
- ++(*pIt);
- ++nResult;
- }
- }
- catch (writerfilter::Exception e)
- {
- clog << "Exception!!" << endl;
- }
-
- char sBuffer[256];
- snprintf(sBuffer, 255, "%d", nResult);
- clog << "Iterator steps:" << sBuffer << endl;
-
- CPPUNIT_ASSERT_MESSAGE("traversing document failed",
- nResult > 0);
- }
-
- void testEvents()
- {
- try
- {
- Stream::Pointer_t pStream = doctok::createStreamHandler();
-
- pDocument->resolve(*pStream);
- }
- catch (writerfilter::Exception e)
- {
- clog << "Exception!!" << endl;
- }
- }
-
- void testEnd()
- {
- ::ucb::ContentBroker::deinitialize();
- }
-
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
- // because these macros are need by auto register mechanism.
-
- CPPUNIT_TEST_SUITE(test);
- CPPUNIT_TEST(testInitUno);
- CPPUNIT_TEST(testOpenFile);
- //CPPUNIT_TEST(testTraversal);
- CPPUNIT_TEST(testEvents);
- CPPUNIT_TEST(testEnd);
- CPPUNIT_TEST_SUITE_END();
- }; // class test
-
- // -----------------------------------------------------------------------------
- CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(testdoctok::test, "doctok");
-} // namespace doctok
-
-// -----------------------------------------------------------------------------
-
-// this macro creates an empty function, which will called by the RegisterAllFunctions()
-// to let the user the possibility to also register some functions by hand.
-NOADDITIONAL;
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */