diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-08-08 16:36:21 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-08-09 13:35:47 +0100 |
commit | bf5f734fc23291e0c1b4285f49f7daab13680ea4 (patch) | |
tree | cdd4e041195deb23f57ef7efac8dc75b748ab9ca /filter/qa | |
parent | add test-case for EDB-22679 (diff) | |
download | core-bf5f734fc23291e0c1b4285f49f7daab13680ea4.tar.gz core-bf5f734fc23291e0c1b4285f49f7daab13680ea4.zip |
add dxf import tests
Change-Id: Ied78545abb9807acfc634ca97a1ca00a163ffa19
Diffstat (limited to 'filter/qa')
-rw-r--r-- | filter/qa/cppunit/data/dxf/fail/.gitignore | 0 | ||||
-rw-r--r-- | filter/qa/cppunit/data/dxf/indeterminate/.gitignore | 1 | ||||
-rw-r--r-- | filter/qa/cppunit/data/dxf/pass/.gitignore | 0 | ||||
-rw-r--r-- | filter/qa/cppunit/filters-dxf-test.cxx | 71 |
4 files changed, 72 insertions, 0 deletions
diff --git a/filter/qa/cppunit/data/dxf/fail/.gitignore b/filter/qa/cppunit/data/dxf/fail/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/filter/qa/cppunit/data/dxf/fail/.gitignore diff --git a/filter/qa/cppunit/data/dxf/indeterminate/.gitignore b/filter/qa/cppunit/data/dxf/indeterminate/.gitignore new file mode 100644 index 000000000000..583b009c7c60 --- /dev/null +++ b/filter/qa/cppunit/data/dxf/indeterminate/.gitignore @@ -0,0 +1 @@ +*.wmf-* diff --git a/filter/qa/cppunit/data/dxf/pass/.gitignore b/filter/qa/cppunit/data/dxf/pass/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/filter/qa/cppunit/data/dxf/pass/.gitignore diff --git a/filter/qa/cppunit/filters-dxf-test.cxx b/filter/qa/cppunit/filters-dxf-test.cxx new file mode 100644 index 000000000000..336b6cd35899 --- /dev/null +++ b/filter/qa/cppunit/filters-dxf-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 DxfFilterTest + : public test::FiltersTest + , public test::BootstrapFixture +{ +public: + DxfFilterTest() : 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(DxfFilterTest); + CPPUNIT_TEST(testCVEs); + CPPUNIT_TEST_SUITE_END(); +}; + +bool DxfFilterTest::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 DxfFilterTest::testCVEs() +{ + testDir(OUString(), + getURLFromSrc("/filter/qa/cppunit/data/dxf/"), + OUString()); +} + +CPPUNIT_TEST_SUITE_REGISTRATION(DxfFilterTest); + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |