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. You may obtain a copy of the License at
8 : * 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 : * The Initial Developer of the Original Code is
16 : * Caolán McNamara <caolanm@redhat.com>
17 : * Portions created by the Initial Developer are Copyright (C) 2011 the
18 : * Initial Developer. All Rights Reserved.
19 : *
20 : * Contributor(s):
21 : * Caolán McNamara <caolanm@redhat.com>
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 <comphelper/documentconstants.hxx>
31 : #include <rtl/ustring.hxx>
32 : #include "unotest/detail/unotestdllapi.hxx"
33 :
34 : namespace test {
35 :
36 : enum filterStatus
37 : {
38 : fail = 0,
39 : pass = 1,
40 : indeterminate = 2
41 : };
42 :
43 : /*
44 : * NOTE, any files beginning with CVE-, BID- or EDB- will be assumed to be
45 : * encrypted using arcfour with key 0x435645, this is to silence panicky
46 : * virus/malware-checkers
47 : *
48 : * e.g. m[de]crypt --bare -a arcfour -o hex -k 435645 -s 3
49 : */
50 : /* Implementation of Filters test */
51 57 : class OOO_DLLPUBLIC_UNOTEST FiltersTest
52 : {
53 : public:
54 : void testDir(
55 : //filter name
56 : const rtl::OUString &rFilter,
57 : //root dir of test files, must contain pass, fail, indeterminate
58 : const rtl::OUString &rURL,
59 : //additional filter data for SfxFilter
60 : const rtl::OUString &rUserData = rtl::OUString(),
61 : //SfxFilterFlags for SfxFilter
62 : unsigned int nFilterFlags = SFX_FILTER_IMPORT,
63 : //Clipboard id for SfxFilter
64 : unsigned int nClipboardID = 0,
65 : //additional filter version for SfxFilter
66 : unsigned int nFilterVersion = 0);
67 :
68 : virtual bool load(
69 : const rtl::OUString &rFilter,
70 : const rtl::OUString &rURL,
71 : const rtl::OUString &rUserData,
72 : unsigned int nFilterFlags,
73 : unsigned int nClipboardID,
74 : unsigned int nFilterVersion) = 0;
75 :
76 : protected:
77 57 : ~FiltersTest() {}
78 :
79 : void recursiveScan(
80 : filterStatus nExpected,
81 : const rtl::OUString &rFilter,
82 : const rtl::OUString &rURL,
83 : const rtl::OUString &rUserData,
84 : unsigned int nFilterFlags,
85 : unsigned int nClipboardID,
86 : unsigned int nFilterVersion);
87 : };
88 :
89 : }
90 :
91 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|