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 | |
parent | 11a514e06bf38c70f2364c8535782aa3f33d6206 (diff) |
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
-rw-r--r-- | filter/CppunitTest_filter_met_test.mk | 43 | ||||
-rw-r--r-- | filter/Module_filter.mk | 1 | ||||
-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 |
7 files changed, 116 insertions, 0 deletions
diff --git a/filter/CppunitTest_filter_met_test.mk b/filter/CppunitTest_filter_met_test.mk new file mode 100644 index 000000000000..a79528c22955 --- /dev/null +++ b/filter/CppunitTest_filter_met_test.mk @@ -0,0 +1,43 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_CppunitTest_CppunitTest,filter_met_test)) + +$(eval $(call gb_CppunitTest_use_external,filter_met_test,boost_headers)) + +$(eval $(call gb_CppunitTest_add_exception_objects,filter_met_test, \ + filter/qa/cppunit/filters-met-test \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,filter_met_test, \ + ime \ + sal \ + test \ + tl \ + unotest \ + vcl \ + $(gb_UWINAPI) \ +)) + +$(eval $(call gb_CppunitTest_use_api,filter_met_test,\ + udkapi \ + offapi \ +)) + +$(eval $(call gb_CppunitTest_use_ure,filter_met_test)) +$(eval $(call gb_CppunitTest_use_vcl,filter_met_test)) + +$(eval $(call gb_CppunitTest_use_components,filter_met_test,\ + configmgr/source/configmgr \ + i18npool/util/i18npool \ +)) + +$(eval $(call gb_CppunitTest_use_configuration,filter_met_test)) + +# vim: set noet sw=4 ts=4: diff --git a/filter/Module_filter.mk b/filter/Module_filter.mk index 25698b9cc14f..a3bddf45cbba 100644 --- a/filter/Module_filter.mk +++ b/filter/Module_filter.mk @@ -86,6 +86,7 @@ $(eval $(call gb_Module_add_check_targets,filter,\ ifneq ($(DISABLE_CVE_TESTS),TRUE) $(eval $(call gb_Module_add_check_targets,filter,\ CppunitTest_filter_dxf_test \ + CppunitTest_filter_met_test \ CppunitTest_filter_pcx_test \ CppunitTest_filter_pict_test \ CppunitTest_filter_ppm_test \ 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: */ |