Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / filter / qa / cppunit / filters-tiff-test.cxx
blob3f6a392082b36b967f12533fb691b182bfaacc46
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * Version: MPL 1.1 / GPLv3+ / LGPLv3+
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/
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.
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.
20 * Contributor(s):
21 * Caolán McNamara <caolanm@redhat.com>
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.
30 #include <unotest/filters-test.hxx>
31 #include <test/bootstrapfixture.hxx>
32 #include <vcl/FilterConfigItem.hxx>
33 #include <tools/stream.hxx>
34 #include <vcl/graph.hxx>
36 #include <osl/file.hxx>
37 #include <osl/process.h>
39 extern "C"
41 SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI
42 GraphicImport(SvStream & rStream, Graphic & rGraphic,
43 FilterConfigItem*, sal_Bool);
46 using namespace ::com::sun::star;
48 /* Implementation of Filters test */
50 class TiffFilterTest
51 : public test::FiltersTest
52 , public test::BootstrapFixture
54 public:
55 TiffFilterTest() : BootstrapFixture(true, false) {}
57 virtual bool load(const rtl::OUString &,
58 const rtl::OUString &rURL, const rtl::OUString &,
59 unsigned int, unsigned int, unsigned int);
61 /**
62 * Ensure CVEs remain unbroken
64 void testCVEs();
66 CPPUNIT_TEST_SUITE(TiffFilterTest);
67 CPPUNIT_TEST(testCVEs);
68 CPPUNIT_TEST_SUITE_END();
71 bool TiffFilterTest::load(const rtl::OUString &,
72 const rtl::OUString &rURL, const rtl::OUString &,
73 unsigned int, unsigned int, unsigned int)
75 SvFileStream aFileStream(rURL, STREAM_READ);
76 Graphic aGraphic;
77 return GraphicImport(aFileStream, aGraphic, NULL, 0);
80 void TiffFilterTest::testCVEs()
82 testDir(rtl::OUString(),
83 getURLFromSrc("/filter/qa/cppunit/data/tiff/"),
84 rtl::OUString());
87 CPPUNIT_TEST_SUITE_REGISTRATION(TiffFilterTest);
89 CPPUNIT_PLUGIN_IMPLEMENT();
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */