Kaydet (Commit) 3e28dff9 authored tarafından Caolán McNamara's avatar Caolán McNamara

add regression tests for psd filter

Change-Id: Ia9b34bc3b77902f8edbc0e7040da5edd02e02879
üst 06abff6c
# -*- 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_psd_test))
$(eval $(call gb_CppunitTest_use_external,filter_psd_test,boost_headers))
$(eval $(call gb_CppunitTest_add_exception_objects,filter_psd_test, \
filter/qa/cppunit/filters-psd-test \
))
$(eval $(call gb_CppunitTest_use_libraries,filter_psd_test, \
ipd \
sal \
test \
tl \
unotest \
vcl \
$(gb_UWINAPI) \
))
$(eval $(call gb_CppunitTest_use_api,filter_psd_test,\
udkapi \
offapi \
))
$(eval $(call gb_CppunitTest_use_ure,filter_psd_test))
$(eval $(call gb_CppunitTest_use_components,filter_psd_test,\
configmgr/source/configmgr \
))
$(eval $(call gb_CppunitTest_use_configuration,filter_psd_test))
# vim: set noet sw=4 ts=4:
...@@ -85,6 +85,7 @@ ifneq ($(DISABLE_CVE_TESTS),TRUE) ...@@ -85,6 +85,7 @@ ifneq ($(DISABLE_CVE_TESTS),TRUE)
$(eval $(call gb_Module_add_check_targets,filter,\ $(eval $(call gb_Module_add_check_targets,filter,\
CppunitTest_filter_pcx_test \ CppunitTest_filter_pcx_test \
CppunitTest_filter_pict_test \ CppunitTest_filter_pict_test \
CppunitTest_filter_psd_test \
CppunitTest_filter_ras_test \ CppunitTest_filter_ras_test \
CppunitTest_filter_tiff_test \ CppunitTest_filter_tiff_test \
CppunitTest_filter_tga_test \ CppunitTest_filter_tga_test \
......
...@@ -27,12 +27,12 @@ using namespace ::com::sun::star; ...@@ -27,12 +27,12 @@ using namespace ::com::sun::star;
/* Implementation of Filters test */ /* Implementation of Filters test */
class RasFilterTest class PcxFilterTest
: public test::FiltersTest : public test::FiltersTest
, public test::BootstrapFixture , public test::BootstrapFixture
{ {
public: public:
RasFilterTest() : BootstrapFixture(true, false) {} PcxFilterTest() : BootstrapFixture(true, false) {}
virtual bool load(const OUString &, virtual bool load(const OUString &,
const OUString &rURL, const OUString &, const OUString &rURL, const OUString &,
...@@ -43,12 +43,12 @@ public: ...@@ -43,12 +43,12 @@ public:
*/ */
void testCVEs(); void testCVEs();
CPPUNIT_TEST_SUITE(RasFilterTest); CPPUNIT_TEST_SUITE(PcxFilterTest);
CPPUNIT_TEST(testCVEs); CPPUNIT_TEST(testCVEs);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
}; };
bool RasFilterTest::load(const OUString &, bool PcxFilterTest::load(const OUString &,
const OUString &rURL, const OUString &, const OUString &rURL, const OUString &,
unsigned int, unsigned int, unsigned int) unsigned int, unsigned int, unsigned int)
{ {
...@@ -57,14 +57,14 @@ bool RasFilterTest::load(const OUString &, ...@@ -57,14 +57,14 @@ bool RasFilterTest::load(const OUString &,
return GraphicImport(aFileStream, aGraphic, NULL); return GraphicImport(aFileStream, aGraphic, NULL);
} }
void RasFilterTest::testCVEs() void PcxFilterTest::testCVEs()
{ {
testDir(OUString(), testDir(OUString(),
getURLFromSrc("/filter/qa/cppunit/data/pcx/"), getURLFromSrc("/filter/qa/cppunit/data/pcx/"),
OUString()); OUString());
} }
CPPUNIT_TEST_SUITE_REGISTRATION(RasFilterTest); CPPUNIT_TEST_SUITE_REGISTRATION(PcxFilterTest);
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
/* -*- 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: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment