LCOV - code coverage report
Current view: top level - hwpfilter/qa/cppunit - test_hwpfilter.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 20 20 100.0 %
Date: 2012-08-25 Functions: 12 13 92.3 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 40 84 47.6 %

           Branch data     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 [ +  - ][ -  + ]:          9 :     class HwpFilterTest
                 [ +  - ]
      43                 :            :         : public test::FiltersTest
      44                 :            :         , public test::BootstrapFixture
      45                 :            :     {
      46                 :            :     public:
      47                 :            :         virtual void setUp();
      48                 :            :         virtual bool load(const rtl::OUString &, const rtl::OUString &rURL, const rtl::OUString &);
      49                 :            :         void test();
      50                 :            : 
      51 [ +  - ][ +  - ]:          6 :         CPPUNIT_TEST_SUITE(HwpFilterTest);
         [ +  - ][ +  - ]
                 [ #  # ]
      52 [ +  - ][ +  - ]:          3 :         CPPUNIT_TEST(test);
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
                 [ +  - ]
      53 [ +  - ][ +  - ]:          6 :         CPPUNIT_TEST_SUITE_END();
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
      54                 :            :     private:
      55                 :            :         uno::Reference<document::XFilter> m_xFilter;
      56                 :            :     };
      57                 :            : 
      58                 :          3 :     void HwpFilterTest::setUp()
      59                 :            :     {
      60                 :          3 :         test::BootstrapFixture::setUp();
      61                 :            : 
      62                 :          3 :         m_xFilter = uno::Reference< document::XFilter >(m_xSFactory->createInstance(
      63                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
      64                 :          3 :                 "com.sun.comp.hwpimport.HwpImportFilter"))),
      65 [ +  - ][ +  - ]:          3 :             uno::UNO_QUERY_THROW);
                 [ +  - ]
      66                 :          3 :     }
      67                 :            : 
      68                 :          6 :     bool HwpFilterTest::load(const rtl::OUString &,
      69                 :            :         const rtl::OUString &rURL, const rtl::OUString &)
      70                 :            :     {
      71         [ +  - ]:          6 :         uno::Sequence< beans::PropertyValue > aDescriptor(1);
      72 [ +  - ][ +  - ]:          6 :         aDescriptor[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL"));
      73 [ +  - ][ +  - ]:          6 :         aDescriptor[0].Value <<= rURL;
      74 [ +  - ][ +  - ]:          6 :         return m_xFilter->filter(aDescriptor);
                 [ +  - ]
      75                 :            :     }
      76                 :            : 
      77                 :          3 :     void HwpFilterTest::test()
      78                 :            :     {
      79                 :            :         testDir(rtl::OUString(),
      80                 :            :             getURLFromSrc("/hwpfilter/qa/cppunit/data/"),
      81 [ +  - ][ +  - ]:          3 :             rtl::OUString());
      82                 :          3 :     }
      83                 :            : 
      84                 :          3 :     CPPUNIT_TEST_SUITE_REGISTRATION(HwpFilterTest);
      85                 :            : }
      86                 :            : 
      87 [ +  - ][ +  - ]:         12 : CPPUNIT_PLUGIN_IMPLEMENT();
         [ +  - ][ +  - ]
         [ +  - ][ #  # ]
      88                 :            : 
      89                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10