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 : * This file incorporates work covered by the following license notice:
10 : *
11 : */
12 :
13 : #include <unotest/filters-test.hxx>
14 : #include <test/bootstrapfixture.hxx>
15 : #include <vcl/FilterConfigItem.hxx>
16 : #include <tools/stream.hxx>
17 : #include <vcl/graph.hxx>
18 :
19 : #include <osl/file.hxx>
20 : #include <osl/process.h>
21 :
22 : #ifdef LIBO_MERGELIBS
23 : #define GraphicImport itiGraphicImport
24 : #endif
25 :
26 : extern "C"
27 : {
28 : SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL
29 : GraphicImport(SvStream & rStream, Graphic & rGraphic,
30 : FilterConfigItem*, sal_Bool);
31 : }
32 :
33 : using namespace ::com::sun::star;
34 :
35 : /* Implementation of Filters test */
36 :
37 2 : class TiffFilterTest
38 : : public test::FiltersTest
39 : , public test::BootstrapFixture
40 : {
41 : public:
42 1 : TiffFilterTest() : BootstrapFixture(true, false) {}
43 :
44 : virtual bool load(const OUString &,
45 : const OUString &rURL, const OUString &,
46 : unsigned int, unsigned int, unsigned int);
47 :
48 : /**
49 : * Ensure CVEs remain unbroken
50 : */
51 : void testCVEs();
52 :
53 2 : CPPUNIT_TEST_SUITE(TiffFilterTest);
54 1 : CPPUNIT_TEST(testCVEs);
55 2 : CPPUNIT_TEST_SUITE_END();
56 : };
57 :
58 12 : bool TiffFilterTest::load(const OUString &,
59 : const OUString &rURL, const OUString &,
60 : unsigned int, unsigned int, unsigned int)
61 : {
62 12 : SvFileStream aFileStream(rURL, STREAM_READ);
63 24 : Graphic aGraphic;
64 24 : return GraphicImport(aFileStream, aGraphic, NULL, 0);
65 : }
66 :
67 1 : void TiffFilterTest::testCVEs()
68 : {
69 : testDir(OUString(),
70 : getURLFromSrc("/filter/qa/cppunit/data/tiff/"),
71 1 : OUString());
72 1 : }
73 :
74 1 : CPPUNIT_TEST_SUITE_REGISTRATION(TiffFilterTest);
75 :
76 4 : CPPUNIT_PLUGIN_IMPLEMENT();
77 :
78 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|