Version 3.6.0.2, tag libreoffice-3.6.0.2
[LibreOffice.git] / svtools / qa / cppunit / filters-test.cxx
blob483a72bcc313f9f8e71e0bf388682cd04d2ddf15
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) 2011 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>
33 #include <osl/file.hxx>
34 #include <osl/process.h>
36 #include <svtools/filter.hxx>
38 using namespace ::com::sun::star;
40 /* Implementation of Filters test */
42 class SvtoolsFiltersTest
43 : public test::FiltersTest
44 , public test::BootstrapFixture
46 public:
47 SvtoolsFiltersTest() : BootstrapFixture(true, false) {}
49 virtual bool load(const rtl::OUString &, const rtl::OUString &rURL, const rtl::OUString &);
51 /**
52 * Ensure CVEs remain unbroken
54 void testCVEs();
56 CPPUNIT_TEST_SUITE(SvtoolsFiltersTest);
57 CPPUNIT_TEST(testCVEs);
58 CPPUNIT_TEST_SUITE_END();
61 bool SvtoolsFiltersTest::load(const rtl::OUString &,
62 const rtl::OUString &rURL, const rtl::OUString &)
64 GraphicFilter aGraphicFilter(false);
65 SvFileStream aFileStream(rURL, STREAM_READ);
66 Graphic aGraphic;
67 return aGraphicFilter.ImportGraphic(aGraphic, rURL, aFileStream) == 0;
70 void SvtoolsFiltersTest::testCVEs()
72 testDir(rtl::OUString(),
73 getURLFromSrc("/svtools/qa/cppunit/data/wmf/"),
74 rtl::OUString());
76 testDir(rtl::OUString(),
77 getURLFromSrc("/svtools/qa/cppunit/data/emf/"),
78 rtl::OUString());
80 testDir(rtl::OUString(),
81 getURLFromSrc("/svtools/qa/cppunit/data/sgv/"),
82 rtl::OUString());
84 testDir(rtl::OUString(),
85 getURLFromSrc("/svtools/qa/cppunit/data/png/"),
86 rtl::OUString());
88 testDir(rtl::OUString(),
89 getURLFromSrc("/svtools/qa/cppunit/data/jpg/"),
90 rtl::OUString());
92 testDir(rtl::OUString(),
93 getURLFromSrc("/svtools/qa/cppunit/data/gif/"),
94 rtl::OUString());
97 CPPUNIT_TEST_SUITE_REGISTRATION(SvtoolsFiltersTest);
99 CPPUNIT_PLUGIN_IMPLEMENT();
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */