Kaydet (Commit) 31bfb20c authored tarafından Caolán McNamara's avatar Caolán McNamara

add a build-time regression test for pcd file format

Change-Id: Ie413372ab1cfc7e38570fdf65c6daca8c2cc426b
üst 7b0f4dc5
# -*- 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_pcd_test))
$(eval $(call gb_CppunitTest_use_external,filter_pcd_test,boost_headers))
$(eval $(call gb_CppunitTest_add_exception_objects,filter_pcd_test, \
filter/qa/cppunit/filters-pcd-test \
))
$(eval $(call gb_CppunitTest_use_libraries,filter_pcd_test, \
icd \
sal \
test \
tl \
unotest \
vcl \
$(gb_UWINAPI) \
))
$(eval $(call gb_CppunitTest_use_api,filter_pcd_test,\
udkapi \
offapi \
))
$(eval $(call gb_CppunitTest_use_ure,filter_pcd_test))
$(eval $(call gb_CppunitTest_use_vcl,filter_pcd_test))
$(eval $(call gb_CppunitTest_use_components,filter_pcd_test,\
configmgr/source/configmgr \
))
$(eval $(call gb_CppunitTest_use_configuration,filter_pcd_test))
# vim: set noet sw=4 ts=4:
......@@ -88,6 +88,7 @@ $(eval $(call gb_Module_add_check_targets,filter,\
CppunitTest_filter_dxf_test \
CppunitTest_filter_eps_test \
CppunitTest_filter_met_test \
CppunitTest_filter_pcd_test \
CppunitTest_filter_pcx_test \
CppunitTest_filter_pict_test \
CppunitTest_filter_ppm_test \
......
/* -*- 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 PcdFilterTest
: public test::FiltersTest
, public test::BootstrapFixture
{
public:
PcdFilterTest() : 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(PcdFilterTest);
CPPUNIT_TEST(testCVEs);
CPPUNIT_TEST_SUITE_END();
};
bool PcdFilterTest::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 PcdFilterTest::testCVEs()
{
testDir(OUString(),
getURLFromSrc("/filter/qa/cppunit/data/pcd/"),
OUString());
}
CPPUNIT_TEST_SUITE_REGISTRATION(PcdFilterTest);
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