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