diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-10-17 16:52:50 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-10-18 10:45:29 +0100 |
commit | 0445a0ea1b11c78f03272d42e5a8829b1bd107e2 (patch) | |
tree | 3b11dfab082bcadd884f1616b53f68bba11a3cf3 /filter/qa | |
parent | coverity#1242573 Untrusted loop bound (diff) | |
download | core-0445a0ea1b11c78f03272d42e5a8829b1bd107e2.tar.gz core-0445a0ea1b11c78f03272d42e5a8829b1bd107e2.zip |
add a regression test for .met files
OS/2 Metafile Format
aka
Presentation Manager Metafile File Format
this format appears to not to have a mime-type
Change-Id: I8b2356fb42272a6e0550abf09f46b051d22b64a5
Diffstat (limited to 'filter/qa')
-rw-r--r-- | filter/qa/cppunit/data/met/fail/.gitignore | 0 | ||||
-rw-r--r-- | filter/qa/cppunit/data/met/indeterminate/.gitignore | 1 | ||||
-rw-r--r-- | filter/qa/cppunit/data/met/pass/.gitignore | 0 | ||||
-rw-r--r-- | filter/qa/cppunit/data/met/pass/sample.met | bin | 0 -> 629 bytes | |||
-rw-r--r-- | filter/qa/cppunit/filters-met-test.cxx | 71 |
5 files changed, 72 insertions, 0 deletions
diff --git a/filter/qa/cppunit/data/met/fail/.gitignore b/filter/qa/cppunit/data/met/fail/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/filter/qa/cppunit/data/met/fail/.gitignore diff --git a/filter/qa/cppunit/data/met/indeterminate/.gitignore b/filter/qa/cppunit/data/met/indeterminate/.gitignore new file mode 100644 index 000000000000..583b009c7c60 --- /dev/null +++ b/filter/qa/cppunit/data/met/indeterminate/.gitignore @@ -0,0 +1 @@ +*.wmf-* diff --git a/filter/qa/cppunit/data/met/pass/.gitignore b/filter/qa/cppunit/data/met/pass/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/filter/qa/cppunit/data/met/pass/.gitignore diff --git a/filter/qa/cppunit/data/met/pass/sample.met b/filter/qa/cppunit/data/met/pass/sample.met Binary files differnew file mode 100644 index 000000000000..7635e841fded --- /dev/null +++ b/filter/qa/cppunit/data/met/pass/sample.met diff --git a/filter/qa/cppunit/filters-met-test.cxx b/filter/qa/cppunit/filters-met-test.cxx new file mode 100644 index 000000000000..b8fc340dffab --- /dev/null +++ b/filter/qa/cppunit/filters-met-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 MetFilterTest + : public test::FiltersTest + , public test::BootstrapFixture +{ +public: + MetFilterTest() : 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(MetFilterTest); + CPPUNIT_TEST(testCVEs); + CPPUNIT_TEST_SUITE_END(); +}; + +bool MetFilterTest::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 MetFilterTest::testCVEs() +{ + testDir(OUString(), + getURLFromSrc("/filter/qa/cppunit/data/met/"), + OUString()); +} + +CPPUNIT_TEST_SUITE_REGISTRATION(MetFilterTest); + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |