add regression tests for psd filter
Change-Id: Ia9b34bc3b77902f8edbc0e7040da5edd02e02879
This commit is contained in:
parent
06abff6cae
commit
3e28dff92c
41
filter/CppunitTest_filter_psd_test.mk
Normal file
41
filter/CppunitTest_filter_psd_test.mk
Normal file
@ -0,0 +1,41 @@
|
||||
# -*- 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)
|
||||
$(eval $(call gb_Module_add_check_targets,filter,\
|
||||
CppunitTest_filter_pcx_test \
|
||||
CppunitTest_filter_pict_test \
|
||||
CppunitTest_filter_psd_test \
|
||||
CppunitTest_filter_ras_test \
|
||||
CppunitTest_filter_tiff_test \
|
||||
CppunitTest_filter_tga_test \
|
||||
|
0
filter/qa/cppunit/data/psd/fail/.gitignore
vendored
Normal file
0
filter/qa/cppunit/data/psd/fail/.gitignore
vendored
Normal file
BIN
filter/qa/cppunit/data/psd/fail/CVE-2007-3741-1.psd
Normal file
BIN
filter/qa/cppunit/data/psd/fail/CVE-2007-3741-1.psd
Normal file
Binary file not shown.
1
filter/qa/cppunit/data/psd/indeterminate/.gitignore
vendored
Normal file
1
filter/qa/cppunit/data/psd/indeterminate/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
*.wmf-*
|
0
filter/qa/cppunit/data/psd/pass/.gitignore
vendored
Normal file
0
filter/qa/cppunit/data/psd/pass/.gitignore
vendored
Normal file
BIN
filter/qa/cppunit/data/psd/pass/rhbz899670-1.psd
Normal file
BIN
filter/qa/cppunit/data/psd/pass/rhbz899670-1.psd
Normal file
Binary file not shown.
@ -27,12 +27,12 @@ using namespace ::com::sun::star;
|
||||
|
||||
/* Implementation of Filters test */
|
||||
|
||||
class RasFilterTest
|
||||
class PcxFilterTest
|
||||
: public test::FiltersTest
|
||||
, public test::BootstrapFixture
|
||||
{
|
||||
public:
|
||||
RasFilterTest() : BootstrapFixture(true, false) {}
|
||||
PcxFilterTest() : BootstrapFixture(true, false) {}
|
||||
|
||||
virtual bool load(const OUString &,
|
||||
const OUString &rURL, const OUString &,
|
||||
@ -43,12 +43,12 @@ public:
|
||||
*/
|
||||
void testCVEs();
|
||||
|
||||
CPPUNIT_TEST_SUITE(RasFilterTest);
|
||||
CPPUNIT_TEST_SUITE(PcxFilterTest);
|
||||
CPPUNIT_TEST(testCVEs);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
};
|
||||
|
||||
bool RasFilterTest::load(const OUString &,
|
||||
bool PcxFilterTest::load(const OUString &,
|
||||
const OUString &rURL, const OUString &,
|
||||
unsigned int, unsigned int, unsigned int)
|
||||
{
|
||||
@ -57,14 +57,14 @@ bool RasFilterTest::load(const OUString &,
|
||||
return GraphicImport(aFileStream, aGraphic, NULL);
|
||||
}
|
||||
|
||||
void RasFilterTest::testCVEs()
|
||||
void PcxFilterTest::testCVEs()
|
||||
{
|
||||
testDir(OUString(),
|
||||
getURLFromSrc("/filter/qa/cppunit/data/pcx/"),
|
||||
OUString());
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(RasFilterTest);
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(PcxFilterTest);
|
||||
|
||||
CPPUNIT_PLUGIN_IMPLEMENT();
|
||||
|
||||
|
71
filter/qa/cppunit/filters-psd-test.cxx
Normal file
71
filter/qa/cppunit/filters-psd-test.cxx
Normal file
@ -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 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: */
|
Loading…
x
Reference in New Issue
Block a user