LCOV - code coverage report
Current view: top level - include/unotest - filters-test.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 2 4 50.0 %
Date: 2015-06-13 12:38:46 Functions: 2 3 66.7 %
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             : #ifndef INCLUDED_UNOTEST_FILTERS_TEST_HXX
      11             : #define INCLUDED_UNOTEST_FILTERS_TEST_HXX
      12             : 
      13             : #include <comphelper/documentconstants.hxx>
      14             : #include <rtl/ustring.hxx>
      15             : #include <unotest/detail/unotestdllapi.hxx>
      16             : #include <sot/formats.hxx>
      17             : 
      18             : namespace test {
      19             : 
      20             : enum filterStatus
      21             : {
      22             :     fail = 0,
      23             :     pass = 1,
      24             :     indeterminate = 2
      25             : };
      26             : 
      27             : /*
      28             :  * NOTE, any files beginning with CVE-, BID- or EDB- will be assumed to be
      29             :  * encrypted using arcfour with key 0x435645, this is to silence panicky
      30             :  * virus/malware-checkers
      31             :  *
      32             :  * e.g.  m[de]crypt --bare -a arcfour -o hex -k 435645 -s 3
      33             :  */
      34             : /* Implementation of Filters test */
      35         346 : class OOO_DLLPUBLIC_UNOTEST FiltersTest
      36             : {
      37             : public:
      38             :     void testDir(
      39             :         //filter name
      40             :         const OUString &rFilter,
      41             :         //root dir of test files, must contain pass, fail, indeterminate
      42             :         const OUString &rURL,
      43             :         //additional filter data for SfxFilter
      44             :         const OUString &rUserData = OUString(),
      45             :         //SfxFilterFlags for SfxFilter
      46             :         SfxFilterFlags nFilterFlags = SfxFilterFlags::IMPORT,
      47             :         //Clipboard id for SfxFilter
      48             :         SotClipboardFormatId nClipboardID = SotClipboardFormatId::NONE,
      49             :         //additional filter version for SfxFilter
      50             :         unsigned int nFilterVersion = 0,
      51             :         //export or import?
      52             :         bool bExport = false);
      53             : 
      54             :     virtual bool load(
      55             :         const OUString &rFilter,
      56             :         const OUString &rURL,
      57             :         const OUString &rUserData,
      58             :         SfxFilterFlags nFilterFlags,
      59             :         SotClipboardFormatId nClipboardID,
      60             :         unsigned int nFilterVersion) = 0;
      61             : 
      62           0 :     virtual bool save(
      63             :         const OUString &/*rFilter*/,
      64             :         const OUString &/*rURL*/,
      65             :         const OUString &/*rUserData*/,
      66             :         SfxFilterFlags /*nFilterFlags*/,
      67             :         SotClipboardFormatId /*nClipboardID*/,
      68             :         unsigned int /*nFilterVersion*/)
      69             :     {
      70           0 :         return true;
      71             :     }
      72             : 
      73             : protected:
      74         346 :     ~FiltersTest() {}
      75             : 
      76             :     void recursiveScan(
      77             :         filterStatus nExpected,
      78             :         const OUString &rFilter,
      79             :         const OUString &rURL,
      80             :         const OUString &rUserData,
      81             :         SfxFilterFlags nFilterFlags,
      82             :         SotClipboardFormatId nClipboardID,
      83             :         unsigned int nFilterVersion,
      84             :         bool bExport);
      85             : };
      86             : 
      87             : }
      88             : 
      89             : #endif // INCLUDED_UNOTEST_FILTERS_TEST_HXX
      90             : 
      91             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11