LCOV - code coverage report
Current view: top level - package/qa/cppunit - test_package.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 14 15 93.3 %
Date: 2015-06-13 12:38:46 Functions: 14 15 93.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             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  */
       9             : 
      10             : #include <comphelper/processfactory.hxx>
      11             : #include <unotest/filters-test.hxx>
      12             : #include <unotest/bootstrapfixturebase.hxx>
      13             : #include "com/sun/star/packages/zip/ZipFileAccess.hpp"
      14             : 
      15             : using namespace ::com::sun::star;
      16             : 
      17             : namespace
      18             : {
      19           2 :     class PackageTest
      20             :         : public test::FiltersTest
      21             :         , public test::BootstrapFixtureBase
      22             :     {
      23             :     public:
      24           1 :         PackageTest() {}
      25             : 
      26             :         virtual bool load(const OUString &,
      27             :             const OUString &rURL, const OUString &,
      28             :             SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
      29             : 
      30             :         void test();
      31             : 
      32           2 :         CPPUNIT_TEST_SUITE(PackageTest);
      33           1 :         CPPUNIT_TEST(test);
      34           5 :         CPPUNIT_TEST_SUITE_END();
      35             :     };
      36             : 
      37           1 :     bool PackageTest::load(const OUString &,
      38             :         const OUString &rURL, const OUString &,
      39             :         SfxFilterFlags, SotClipboardFormatId, unsigned int)
      40             :     {
      41             :         try
      42             :         {
      43             :             uno::Reference<css::packages::zip::XZipFileAccess2> xZip(
      44           2 :                 css::packages::zip::ZipFileAccess::createWithURL(comphelper::getProcessComponentContext(), rURL));
      45           0 :             return xZip.is();
      46             :         }
      47           2 :         catch(...)
      48             :         {
      49           1 :             return false;
      50             :         }
      51             :     }
      52             : 
      53           1 :     void PackageTest::test()
      54             :     {
      55             :         testDir(OUString(),
      56             :             getURLFromSrc("/package/qa/cppunit/data/"),
      57           1 :             OUString());
      58           1 :     }
      59             : 
      60           1 :     CPPUNIT_TEST_SUITE_REGISTRATION(PackageTest);
      61             : }
      62             : 
      63           4 : CPPUNIT_PLUGIN_IMPLEMENT();
      64             : 
      65             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11