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) 2012 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 <unotest/filters-test.hxx>
31 : #include <test/bootstrapfixture.hxx>
32 : #include <svtools/FilterConfigItem.hxx>
33 : #include <tools/stream.hxx>
34 : #include <vcl/graph.hxx>
35 :
36 : #include <osl/file.hxx>
37 : #include <osl/process.h>
38 :
39 : extern "C"
40 : {
41 : SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL
42 : GraphicImport(SvStream & rStream, Graphic & rGraphic,
43 : FilterConfigItem*, sal_Bool);
44 : }
45 :
46 : using namespace ::com::sun::star;
47 :
48 : /* Implementation of Filters test */
49 :
50 2 : class TiffFilterTest
51 : : public test::FiltersTest
52 : , public test::BootstrapFixture
53 : {
54 : public:
55 1 : TiffFilterTest() : BootstrapFixture(true, false) {}
56 :
57 : virtual bool load(const rtl::OUString &,
58 : const rtl::OUString &rURL, const rtl::OUString &,
59 : unsigned int, unsigned int, unsigned int);
60 :
61 : /**
62 : * Ensure CVEs remain unbroken
63 : */
64 : void testCVEs();
65 :
66 2 : CPPUNIT_TEST_SUITE(TiffFilterTest);
67 1 : CPPUNIT_TEST(testCVEs);
68 2 : CPPUNIT_TEST_SUITE_END();
69 : };
70 :
71 11 : bool TiffFilterTest::load(const rtl::OUString &,
72 : const rtl::OUString &rURL, const rtl::OUString &,
73 : unsigned int, unsigned int, unsigned int)
74 : {
75 11 : SvFileStream aFileStream(rURL, STREAM_READ);
76 11 : Graphic aGraphic;
77 11 : return GraphicImport(aFileStream, aGraphic, NULL, 0);
78 : }
79 :
80 1 : void TiffFilterTest::testCVEs()
81 : {
82 : testDir(rtl::OUString(),
83 : getURLFromSrc("/filter/qa/cppunit/data/tiff/"),
84 1 : rtl::OUString());
85 1 : }
86 :
87 1 : CPPUNIT_TEST_SUITE_REGISTRATION(TiffFilterTest);
88 :
89 4 : CPPUNIT_PLUGIN_IMPLEMENT();
90 :
91 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|