diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-04-17 11:58:38 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-04-17 12:00:40 +0100 |
commit | 9de20d1eb046f7bb92d893408206b91a9c054e2e (patch) | |
tree | 262283d5c57200481652d7825261ff895bea4b68 /filter/qa | |
parent | Resolves: rhbz#1086714 overlarge pixmap (diff) | |
download | core-9de20d1eb046f7bb92d893408206b91a9c054e2e.tar.gz core-9de20d1eb046f7bb92d893408206b91a9c054e2e.zip |
add tests for CVE-2008-1097, etc.
Change-Id: Iad6948fdf6eb60f86d764783b72a4fe7f5642e40
Diffstat (limited to 'filter/qa')
-rw-r--r-- | filter/qa/cppunit/data/pcx/fail/.gitignore | 0 | ||||
-rw-r--r-- | filter/qa/cppunit/data/pcx/fail/CVE-2008-1097-1.pcx | bin | 0 -> 91531 bytes | |||
-rw-r--r-- | filter/qa/cppunit/data/pcx/indeterminate/.gitignore | 1 | ||||
-rw-r--r-- | filter/qa/cppunit/data/pcx/pass/.gitignore | 0 | ||||
-rw-r--r-- | filter/qa/cppunit/data/pcx/pass/rhbz469075-1.pcx | bin | 0 -> 58596 bytes | |||
-rw-r--r-- | filter/qa/cppunit/filters-pcx-test.cxx | 71 |
6 files changed, 72 insertions, 0 deletions
diff --git a/filter/qa/cppunit/data/pcx/fail/.gitignore b/filter/qa/cppunit/data/pcx/fail/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/filter/qa/cppunit/data/pcx/fail/.gitignore diff --git a/filter/qa/cppunit/data/pcx/fail/CVE-2008-1097-1.pcx b/filter/qa/cppunit/data/pcx/fail/CVE-2008-1097-1.pcx Binary files differnew file mode 100644 index 000000000000..c55c64ed9a8a --- /dev/null +++ b/filter/qa/cppunit/data/pcx/fail/CVE-2008-1097-1.pcx diff --git a/filter/qa/cppunit/data/pcx/indeterminate/.gitignore b/filter/qa/cppunit/data/pcx/indeterminate/.gitignore new file mode 100644 index 000000000000..583b009c7c60 --- /dev/null +++ b/filter/qa/cppunit/data/pcx/indeterminate/.gitignore @@ -0,0 +1 @@ +*.wmf-* diff --git a/filter/qa/cppunit/data/pcx/pass/.gitignore b/filter/qa/cppunit/data/pcx/pass/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/filter/qa/cppunit/data/pcx/pass/.gitignore diff --git a/filter/qa/cppunit/data/pcx/pass/rhbz469075-1.pcx b/filter/qa/cppunit/data/pcx/pass/rhbz469075-1.pcx Binary files differnew file mode 100644 index 000000000000..d928c08908ba --- /dev/null +++ b/filter/qa/cppunit/data/pcx/pass/rhbz469075-1.pcx diff --git a/filter/qa/cppunit/filters-pcx-test.cxx b/filter/qa/cppunit/filters-pcx-test.cxx new file mode 100644 index 000000000000..678b2673956e --- /dev/null +++ b/filter/qa/cppunit/filters-pcx-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 RasFilterTest + : public test::FiltersTest + , public test::BootstrapFixture +{ +public: + RasFilterTest() : 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(RasFilterTest); + CPPUNIT_TEST(testCVEs); + CPPUNIT_TEST_SUITE_END(); +}; + +bool RasFilterTest::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 RasFilterTest::testCVEs() +{ + testDir(OUString(), + getURLFromSrc("/filter/qa/cppunit/data/pcx/"), + OUString()); +} + +CPPUNIT_TEST_SUITE_REGISTRATION(RasFilterTest); + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |