Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / filter / qa / cppunit / filters-pict-test.cxx
blob5e5874f31856f6facaea00b21ad6a451c334b18f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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 */
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>
16 #include <osl/file.hxx>
17 #include <osl/process.h>
19 extern "C"
21 SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI
22 GraphicImport(SvStream & rStream, Graphic & rGraphic,
23 FilterConfigItem*, sal_Bool);
26 using namespace ::com::sun::star;
28 /* Implementation of Filters test */
30 class PictFilterTest
31 : public test::FiltersTest
32 , public test::BootstrapFixture
34 public:
35 PictFilterTest() : BootstrapFixture(true, false) {}
37 virtual bool load(const rtl::OUString &,
38 const rtl::OUString &rURL, const rtl::OUString &,
39 unsigned int, unsigned int, unsigned int);
41 /**
42 * Ensure CVEs remain unbroken
44 void testCVEs();
46 CPPUNIT_TEST_SUITE(PictFilterTest);
47 CPPUNIT_TEST(testCVEs);
48 CPPUNIT_TEST_SUITE_END();
51 bool PictFilterTest::load(const rtl::OUString &,
52 const rtl::OUString &rURL, const rtl::OUString &,
53 unsigned int, unsigned int, unsigned int)
55 SvFileStream aFileStream(rURL, STREAM_READ);
56 Graphic aGraphic;
57 return GraphicImport(aFileStream, aGraphic, NULL, 0);
60 void PictFilterTest::testCVEs()
62 testDir(rtl::OUString(),
63 getURLFromSrc("/filter/qa/cppunit/data/pict/"),
64 rtl::OUString());
67 CPPUNIT_TEST_SUITE_REGISTRATION(PictFilterTest);
69 CPPUNIT_PLUGIN_IMPLEMENT();
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */