Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / filter / qa / cppunit / filters-ppm-test.cxx
blob0eefd1979203d747a1ddc9033953c1f3d245aece
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 bool SAL_CALL
22 ipbGraphicImport(SvStream & rStream, Graphic & rGraphic,
23 FilterConfigItem*);
26 using namespace ::com::sun::star;
28 /* Implementation of Filters test */
30 class PpmFilterTest
31 : public test::FiltersTest
32 , public test::BootstrapFixture
34 public:
35 PpmFilterTest() : BootstrapFixture(true, false) {}
37 virtual bool load(const OUString &,
38 const OUString &rURL, const OUString &,
39 SfxFilterFlags, SotClipboardFormatId, unsigned int) override;
41 /**
42 * Ensure CVEs remain unbroken
44 void testCVEs();
46 CPPUNIT_TEST_SUITE(PpmFilterTest);
47 CPPUNIT_TEST(testCVEs);
48 CPPUNIT_TEST_SUITE_END();
51 bool PpmFilterTest::load(const OUString &,
52 const OUString &rURL, const OUString &,
53 SfxFilterFlags, SotClipboardFormatId, unsigned int)
55 SvFileStream aFileStream(rURL, StreamMode::READ);
56 Graphic aGraphic;
57 return ipbGraphicImport(aFileStream, aGraphic, nullptr);
60 void PpmFilterTest::testCVEs()
62 testDir(OUString(),
63 m_directories.getURLFromSrc("/filter/qa/cppunit/data/ppm/"));
65 testDir(OUString(),
66 m_directories.getURLFromSrc("/filter/qa/cppunit/data/pbm/"));
69 CPPUNIT_TEST_SUITE_REGISTRATION(PpmFilterTest);
71 CPPUNIT_PLUGIN_IMPLEMENT();
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */