diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-04-17 16:18:49 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-04-17 16:19:39 +0100 |
commit | 3e28dff92cc25e7058e18545998088cad3ba6ccf (patch) | |
tree | 6cd7416715c23da41b39773d6955709dcc3d08e8 /filter/qa | |
parent | oox customshapepresetdata: parse SubViewSize (diff) | |
download | core-3e28dff92cc25e7058e18545998088cad3ba6ccf.tar.gz core-3e28dff92cc25e7058e18545998088cad3ba6ccf.zip |
add regression tests for psd filter
Change-Id: Ia9b34bc3b77902f8edbc0e7040da5edd02e02879
Diffstat (limited to 'filter/qa')
-rw-r--r-- | filter/qa/cppunit/data/psd/fail/.gitignore | 0 | ||||
-rw-r--r-- | filter/qa/cppunit/data/psd/fail/CVE-2007-3741-1.psd | bin | 0 -> 896870 bytes | |||
-rw-r--r-- | filter/qa/cppunit/data/psd/indeterminate/.gitignore | 1 | ||||
-rw-r--r-- | filter/qa/cppunit/data/psd/pass/.gitignore | 0 | ||||
-rw-r--r-- | filter/qa/cppunit/data/psd/pass/rhbz899670-1.psd | bin | 0 -> 2147990 bytes | |||
-rw-r--r-- | filter/qa/cppunit/filters-pcx-test.cxx | 12 | ||||
-rw-r--r-- | filter/qa/cppunit/filters-psd-test.cxx | 71 |
7 files changed, 78 insertions, 6 deletions
diff --git a/filter/qa/cppunit/data/psd/fail/.gitignore b/filter/qa/cppunit/data/psd/fail/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/filter/qa/cppunit/data/psd/fail/.gitignore diff --git a/filter/qa/cppunit/data/psd/fail/CVE-2007-3741-1.psd b/filter/qa/cppunit/data/psd/fail/CVE-2007-3741-1.psd Binary files differnew file mode 100644 index 000000000000..59b690063b7b --- /dev/null +++ b/filter/qa/cppunit/data/psd/fail/CVE-2007-3741-1.psd diff --git a/filter/qa/cppunit/data/psd/indeterminate/.gitignore b/filter/qa/cppunit/data/psd/indeterminate/.gitignore new file mode 100644 index 000000000000..583b009c7c60 --- /dev/null +++ b/filter/qa/cppunit/data/psd/indeterminate/.gitignore @@ -0,0 +1 @@ +*.wmf-* diff --git a/filter/qa/cppunit/data/psd/pass/.gitignore b/filter/qa/cppunit/data/psd/pass/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/filter/qa/cppunit/data/psd/pass/.gitignore diff --git a/filter/qa/cppunit/data/psd/pass/rhbz899670-1.psd b/filter/qa/cppunit/data/psd/pass/rhbz899670-1.psd Binary files differnew file mode 100644 index 000000000000..ce8de8493ebe --- /dev/null +++ b/filter/qa/cppunit/data/psd/pass/rhbz899670-1.psd diff --git a/filter/qa/cppunit/filters-pcx-test.cxx b/filter/qa/cppunit/filters-pcx-test.cxx index 678b2673956e..013d96de8208 100644 --- a/filter/qa/cppunit/filters-pcx-test.cxx +++ b/filter/qa/cppunit/filters-pcx-test.cxx @@ -27,12 +27,12 @@ using namespace ::com::sun::star; /* Implementation of Filters test */ -class RasFilterTest +class PcxFilterTest : public test::FiltersTest , public test::BootstrapFixture { public: - RasFilterTest() : BootstrapFixture(true, false) {} + PcxFilterTest() : BootstrapFixture(true, false) {} virtual bool load(const OUString &, const OUString &rURL, const OUString &, @@ -43,12 +43,12 @@ public: */ void testCVEs(); - CPPUNIT_TEST_SUITE(RasFilterTest); + CPPUNIT_TEST_SUITE(PcxFilterTest); CPPUNIT_TEST(testCVEs); CPPUNIT_TEST_SUITE_END(); }; -bool RasFilterTest::load(const OUString &, +bool PcxFilterTest::load(const OUString &, const OUString &rURL, const OUString &, unsigned int, unsigned int, unsigned int) { @@ -57,14 +57,14 @@ bool RasFilterTest::load(const OUString &, return GraphicImport(aFileStream, aGraphic, NULL); } -void RasFilterTest::testCVEs() +void PcxFilterTest::testCVEs() { testDir(OUString(), getURLFromSrc("/filter/qa/cppunit/data/pcx/"), OUString()); } -CPPUNIT_TEST_SUITE_REGISTRATION(RasFilterTest); +CPPUNIT_TEST_SUITE_REGISTRATION(PcxFilterTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/filter/qa/cppunit/filters-psd-test.cxx b/filter/qa/cppunit/filters-psd-test.cxx new file mode 100644 index 000000000000..95ab882d82e5 --- /dev/null +++ b/filter/qa/cppunit/filters-psd-test.cxx @@ -0,0 +1,71 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <unotest/filters-test.hxx> +#include <test/bootstrapfixture.hxx> +#include <vcl/FilterConfigItem.hxx> +#include <tools/stream.hxx> +#include <vcl/graph.hxx> + +#include <osl/file.hxx> +#include <osl/process.h> + +extern "C" +{ + SAL_DLLPUBLIC_EXPORT bool SAL_CALL + GraphicImport(SvStream & rStream, Graphic & rGraphic, + FilterConfigItem*); +} + +using namespace ::com::sun::star; + +/* Implementation of Filters test */ + +class PsdFilterTest + : public test::FiltersTest + , public test::BootstrapFixture +{ +public: + PsdFilterTest() : BootstrapFixture(true, false) {} + + virtual bool load(const OUString &, + const OUString &rURL, const OUString &, + unsigned int, unsigned int, unsigned int) SAL_OVERRIDE; + + /** + * Ensure CVEs remain unbroken + */ + void testCVEs(); + + CPPUNIT_TEST_SUITE(PsdFilterTest); + CPPUNIT_TEST(testCVEs); + CPPUNIT_TEST_SUITE_END(); +}; + +bool PsdFilterTest::load(const OUString &, + const OUString &rURL, const OUString &, + unsigned int, unsigned int, unsigned int) +{ + SvFileStream aFileStream(rURL, STREAM_READ); + Graphic aGraphic; + return GraphicImport(aFileStream, aGraphic, NULL); +} + +void PsdFilterTest::testCVEs() +{ + testDir(OUString(), + getURLFromSrc("/filter/qa/cppunit/data/psd/"), + OUString()); +} + +CPPUNIT_TEST_SUITE_REGISTRATION(PsdFilterTest); + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |