LCOV - code coverage report
Current view: top level - libreoffice/hwpfilter/qa/cppunit - test_hwpfilter.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 20 20 100.0 %
Date: 2012-12-27 Functions: 12 13 92.3 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * Version: MPL 1.1 / GPLv3+ / LGPLv3+
       4             :  *
       5             :  * The contents of this file are subject to the Mozilla Public License Version
       6             :  * 1.1 (the "License"); you may not use this file except in compliance with
       7             :  * the License or as specified alternatively below. You may obtain a copy of
       8             :  * the License at http://www.mozilla.org/MPL/
       9             :  *
      10             :  * Software distributed under the License is distributed on an "AS IS" basis,
      11             :  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
      12             :  * for the specific language governing rights and limitations under the
      13             :  * License.
      14             :  *
      15             :  * Major Contributor(s):
      16             :  * Copyright (C) 2011 Red Hat, Inc., Caolán McNamara <caolanm@redhat.com>
      17             :  *  (initial developer)
      18             :  *
      19             :  * All Rights Reserved.
      20             :  *
      21             :  * For minor contributions see the git repository.
      22             :  *
      23             :  * Alternatively, the contents of this file may be used under the terms of
      24             :  * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
      25             :  * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
      26             :  * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
      27             :  * instead of those above.
      28             :  */
      29             : 
      30             : #include <unotest/filters-test.hxx>
      31             : #include <test/bootstrapfixture.hxx>
      32             : #include <com/sun/star/document/XFilter.hpp>
      33             : 
      34             : #include <osl/file.hxx>
      35             : #include <osl/process.h>
      36             : #include <osl/thread.h>
      37             : 
      38             : using namespace ::com::sun::star;
      39             : 
      40             : namespace
      41             : {
      42           3 :     class HwpFilterTest
      43             :         : public test::FiltersTest
      44             :         , public test::BootstrapFixture
      45             :     {
      46             :     public:
      47             :         virtual void setUp();
      48             : 
      49             :         virtual bool load(const rtl::OUString &,
      50             :             const rtl::OUString &rURL, const rtl::OUString &,
      51             :             unsigned int, unsigned int, unsigned int);
      52             : 
      53             :         void test();
      54             : 
      55           2 :         CPPUNIT_TEST_SUITE(HwpFilterTest);
      56           1 :         CPPUNIT_TEST(test);
      57           2 :         CPPUNIT_TEST_SUITE_END();
      58             :     private:
      59             :         uno::Reference<document::XFilter> m_xFilter;
      60             :     };
      61             : 
      62           1 :     void HwpFilterTest::setUp()
      63             :     {
      64           1 :         test::BootstrapFixture::setUp();
      65             : 
      66           1 :         m_xFilter = uno::Reference< document::XFilter >(m_xSFactory->createInstance(
      67             :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
      68           1 :                 "com.sun.comp.hwpimport.HwpImportFilter"))),
      69           1 :             uno::UNO_QUERY_THROW);
      70           1 :     }
      71             : 
      72           2 :     bool HwpFilterTest::load(const rtl::OUString &,
      73             :         const rtl::OUString &rURL, const rtl::OUString &,
      74             :         unsigned int, unsigned int, unsigned int)
      75             :     {
      76           2 :         uno::Sequence< beans::PropertyValue > aDescriptor(1);
      77           2 :         aDescriptor[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL"));
      78           2 :         aDescriptor[0].Value <<= rURL;
      79           2 :         return m_xFilter->filter(aDescriptor);
      80             :     }
      81             : 
      82           1 :     void HwpFilterTest::test()
      83             :     {
      84             :         testDir(rtl::OUString(),
      85             :             getURLFromSrc("/hwpfilter/qa/cppunit/data/"),
      86           1 :             rtl::OUString());
      87           1 :     }
      88             : 
      89           1 :     CPPUNIT_TEST_SUITE_REGISTRATION(HwpFilterTest);
      90             : }
      91             : 
      92           4 : CPPUNIT_PLUGIN_IMPLEMENT();
      93             : 
      94             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10