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