Kaydet (Commit) 48af0b93 authored tarafından Armin Le Grand's avatar Armin Le Grand Kaydeden (comit) Thorsten Behrens

emfplus: UnitTests and gerrit build corrections

Needed to migrate UnitTest for Emf/Wmf import from
vcl to emfio. Corrected stuff based on gerrit build
feedback

Change-Id: I7fd2456f814ea19583072ba09730a07e9b9d4061
üst 762c5234
......@@ -390,7 +390,7 @@ namespace emfplushelper
void EmfPlusHelperData::processEmfPlusData(
SvMemoryStream& rMS,
const drawinglayer::geometry::ViewInformation2D& rViewInformation)
const drawinglayer::geometry::ViewInformation2D& /*rViewInformation*/)
{
sal_uInt64 length = rMS.GetSize();
......@@ -862,6 +862,10 @@ namespace emfplushelper
SAL_INFO("cppcanvas.emf", "EMF+ DrawString layoutRect: " << lx << "," << ly << " - " << lw << "x" << lh);
OUString text = read_uInt16s_ToOUString(rMS, stringLength);
EMFPStringFormat *stringFormat = static_cast< EMFPStringFormat* >(maEMFPObjects[formatId & 0xff].get());
(void)(text); // avoid warning
(void)(stringFormat); // avoid warning
// css::rendering::FontRequest aFontRequest;
//
// if (stringFormat)
......
......@@ -46,6 +46,7 @@
#include <vcl/gradient.hxx>
#include <vcl/hatch.hxx>
#include <emfplushelper.hxx>
#include <numeric>
namespace drawinglayer
{
......
......@@ -21,6 +21,10 @@ $(eval $(call gb_CppunitTest_use_externals,emfio,\
libxml2 \
))
$(eval $(call gb_CppunitTest_add_exception_objects,emfio,\
emfio/qa/cppunit/emf/EmfImportTest \
))
$(eval $(call gb_CppunitTest_use_sdk_api,emfio))
$(eval $(call gb_CppunitTest_use_library_objects,emfio,\
......@@ -42,10 +46,6 @@ $(eval $(call gb_CppunitTest_use_libraries,emfio,\
utl \
))
$(eval $(call gb_CppunitTest_add_exception_objects,emfio,\
emfio/qa/cppunit/EmfImportTest \
))
$(eval $(call gb_CppunitTest_use_ure,emfio))
$(eval $(call gb_CppunitTest_use_vcl,emfio))
......
......@@ -7,46 +7,39 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_CppunitTest_CppunitTest,vcl_wmf_test))
$(eval $(call gb_CppunitTest_CppunitTest,emfio))
$(eval $(call gb_CppunitTest_add_exception_objects,vcl_wmf_test, \
vcl/qa/cppunit/wmf/wmfimporttest \
$(eval $(call gb_CppunitTest_set_componentfile,emfio,emfio/emfio))
$(eval $(call gb_CppunitTest_set_include,emfio,\
$$(INCLUDE) \
-I$(SRCDIR)/emfio/inc \
))
$(eval $(call gb_CppunitTest_use_externals,vcl_wmf_test,\
$(eval $(call gb_CppunitTest_use_externals,emfio,\
boost_headers \
libxml2 \
$(if $(filter PDFIUM,$(BUILD_TYPE)),pdfium) \
))
$(eval $(call gb_CppunitTest_set_include,vcl_wmf_test,\
$$(INCLUDE) \
-I$(SRCDIR)/vcl/inc \
-I$(SRCDIR)/vcl/source/filter/wmf \
$(eval $(call gb_CppunitTest_add_exception_objects,emfio, \
emfio/qa/cppunit/wmf/wmfimporttest \
))
$(eval $(call gb_CppunitTest_use_library_objects,vcl_wmf_test, \
test-setupvcl \
vcl \
))
$(eval $(call gb_CppunitTest_use_sdk_api,emfio))
$(eval $(call gb_CppunitTest_use_externals,vcl_wmf_test,\
$(if $(filter LINUX MACOSX %BSD SOLARIS,$(OS)), \
curl) \
jpeg \
$(if $(filter-out IOS WNT,$(OS)), \
nss3 \
plc4) \
libeot \
$(eval $(call gb_CppunitTest_use_library_objects,emfio, \
emfio \
))
$(eval $(call gb_CppunitTest_use_libraries,vcl_wmf_test,\
$(eval $(call gb_CppunitTest_use_libraries,emfio,\
$(call gb_Helper_optional,BREAKPAD, \
crashreport) \
basegfx \
comphelper \
drawinglayer \
cppu \
cppuhelper \
comphelper \
i18nlangtag \
i18nutil \
$(if $(filter OPENCL,$(BUILD_TYPE)),opencl) \
......@@ -56,15 +49,27 @@ $(eval $(call gb_CppunitTest_use_libraries,vcl_wmf_test,\
svl \
svt \
test \
test-setupvcl \
tl \
ucbhelper \
unotest \
vcl \
utl \
xmlreader \
))
$(eval $(call gb_CppunitTest_use_externals,emfio,\
$(if $(filter LINUX MACOSX %BSD SOLARIS,$(OS)), \
curl) \
jpeg \
$(if $(filter-out IOS WNT,$(OS)), \
nss3 \
plc4) \
libeot \
))
ifeq ($(OS),MACOSX)
$(eval $(call gb_CppunitTest_add_libs,vcl_wmf_test,\
$(eval $(call gb_CppunitTest_add_libs,emfio,\
-framework IOKit \
-F/System/Library/PrivateFrameworks \
-framework CoreUI \
......@@ -73,12 +78,12 @@ $(eval $(call gb_CppunitTest_add_libs,vcl_wmf_test,\
endif
ifeq ($(ENABLE_JAVA),TRUE)
$(eval $(call gb_CppunitTest_use_libraries,vcl_wmf_test,\
$(eval $(call gb_CppunitTest_use_libraries,emfio,\
jvmaccess \
))
endif
$(eval $(call gb_CppunitTest_use_externals,vcl_wmf_test,\
$(eval $(call gb_CppunitTest_use_externals,emfio,\
gio \
graphite \
harfbuzz \
......@@ -86,30 +91,30 @@ $(eval $(call gb_CppunitTest_use_externals,vcl_wmf_test,\
lcms2 \
))
ifeq ($(ENABLE_HEADLESS),)
$(eval $(call gb_CppunitTest_use_externals,vcl_wmf_test,\
$(eval $(call gb_CppunitTest_use_externals,emfio,\
epoxy \
))
endif
ifeq ($(OS),MACOSX)
$(eval $(call gb_CppunitTest_use_system_darwin_frameworks,vcl_wmf_test,\
$(eval $(call gb_CppunitTest_use_system_darwin_frameworks,emfio,\
ApplicationServices \
))
$(eval $(call gb_CppunitTest_use_system_darwin_frameworks,vcl_wmf_test,\
$(eval $(call gb_CppunitTest_use_system_darwin_frameworks,emfio,\
$(if $(filter X86_64,$(CPUNAME)),,QuickTime) \
Cocoa \
Carbon \
CoreFoundation \
))
ifneq ($(ENABLE_MACOSX_SANDBOX),TRUE)
$(eval $(call gb_CppunitTest_use_libraries,vcl_wmf_test,\
$(eval $(call gb_CppunitTest_use_libraries,emfio,\
AppleRemote \
))
endif
endif
ifeq ($(USING_X11),TRUE)
$(eval $(call gb_CppunitTest_use_externals,vcl_wmf_test,\
$(eval $(call gb_CppunitTest_use_externals,emfio,\
cairo \
cups \
dbus \
......@@ -120,14 +125,14 @@ $(eval $(call gb_CppunitTest_use_externals,vcl_wmf_test,\
endif
ifeq ($(ENABLE_HEADLESS),TRUE)
$(eval $(call gb_CppunitTest_use_externals,vcl_wmf_test,\
$(eval $(call gb_CppunitTest_use_externals,emfio,\
cairo \
freetype \
fontconfig \
))
else
ifeq ($(OS),LINUX)
$(eval $(call gb_CppunitTest_add_libs,vcl_wmf_test,\
$(eval $(call gb_CppunitTest_add_libs,emfio,\
-lm \
-ldl \
-lpthread \
......@@ -137,12 +142,12 @@ endif
endif
ifeq ($(OS),ANDROID)
$(eval $(call gb_CppunitTest_add_libs,vcl_wmf_test,\
$(eval $(call gb_CppunitTest_add_libs,emfio,\
-llog \
-landroid \
-llo-bootstrap \
))
$(eval $(call gb_CppunitTest_use_externals,vcl_wmf_test,\
$(eval $(call gb_CppunitTest_use_externals,emfio,\
cairo \
fontconfig \
freetype \
......@@ -151,14 +156,14 @@ $(eval $(call gb_CppunitTest_use_externals,vcl_wmf_test,\
endif
ifeq ($(OS),IOS)
$(eval $(call gb_CppunitTest_use_system_darwin_frameworks,vcl_wmf_test,\
$(eval $(call gb_CppunitTest_use_system_darwin_frameworks,emfio,\
UIKit \
CoreFoundation \
))
endif
ifeq ($(OS),WNT)
$(eval $(call gb_CppunitTest_use_system_win32_libs,vcl_wmf_test,\
$(eval $(call gb_CppunitTest_use_system_win32_libs,emfio,\
advapi32 \
crypt32 \
gdi32 \
......@@ -174,11 +179,11 @@ $(eval $(call gb_CppunitTest_use_system_win32_libs,vcl_wmf_test,\
setupapi \
shlwapi \
))
#$(eval $(call gb_CppunitTest_add_nativeres,vcl_wmf_test,vcl/salsrc))
#$(eval $(call gb_CppunitTest_add_nativeres,emfio,vcl/salsrc))
endif
ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
$(eval $(call gb_CppunitTest_add_libs,vcl_wmf_test,\
$(eval $(call gb_CppunitTest_add_libs,emfio,\
-lm $(DLOPEN_LIBS) \
-lpthread \
-lX11 \
......@@ -186,29 +191,27 @@ $(eval $(call gb_CppunitTest_add_libs,vcl_wmf_test,\
))
endif
$(eval $(call gb_CppunitTest_use_sdk_api,vcl_wmf_test))
$(eval $(call gb_CppunitTest_use_ure,vcl_wmf_test))
$(eval $(call gb_CppunitTest_use_ure,emfio))
$(eval $(call gb_CppunitTest_use_components,vcl_wmf_test,\
$(eval $(call gb_CppunitTest_use_components,emfio,\
configmgr/source/configmgr \
i18npool/util/i18npool \
ucb/source/core/ucb1 \
unotools/util/utl \
))
$(eval $(call gb_CppunitTest_use_configuration,vcl_wmf_test))
$(eval $(call gb_CppunitTest_use_configuration,emfio))
# See gb_CppunitTest__use_vcl (solenv/gbuild/CppunitTest.mk; headless):
ifeq ($(USING_X11),TRUE)
$(call gb_CppunitTest_get_target,vcl_wmf_test): \
$(call gb_CppunitTest_get_target,emfio): \
$(call gb_Library_get_target,desktop_detector)
endif
# Hack to suppress ASan ODR violation warnings about symbols present in both the
# vcl objects linked into this test library and the vcl library (which gets
# dynamically loaded during the test):
$(call gb_CppunitTest_get_target,vcl_wmf_test): \
$(call gb_CppunitTest_get_target,emfio): \
EXTRA_ENV_VARS := \
ASAN_OPTIONS="$${ASAN_OPTIONS+$$ASAN_OPTIONS:}"detect_odr_violation=0
......
......@@ -23,7 +23,8 @@ $(eval $(call gb_Module_add_targets,emfio,\
))
$(eval $(call gb_Module_add_check_targets,emfio,\
CppunitTest_emfio \
CppunitTest_emfio_emf_test \
$(if $(MERGELIBS),,CppunitTest_emfio_wmf_test) \
))
# vim: set noet ts=4 sw=4:
......@@ -599,7 +599,7 @@ namespace emfio
bool bDrawTo = false,
bool bRecordPath = false
);
void DrawPolyBezier(tools::Polygon rPolygin,
void DrawPolyBezier(tools::Polygon rPolygon,
bool bDrawTo,
bool bRecordPath
);
......
......@@ -23,6 +23,7 @@
#include <unotest/bootstrapfixturebase.hxx>
#include <vcl/wmf.hxx>
#include <vcl/metaact.hxx>
#include <mtftools.hxx>
using namespace css;
......@@ -37,7 +38,7 @@ class WmfTest : public test::BootstrapFixtureBase, public XmlTestTools
public:
WmfTest() :
maDataUrl("/vcl/qa/cppunit/wmf/data/")
maDataUrl("/emfio/qa/cppunit/wmf/data/")
{}
// Hack around missing "once per class" setUp/tearDown in CppUnit; must be
......@@ -248,7 +249,7 @@ void WmfTest::testTdf99402()
{
// Symbol font should arrive with RTL_TEXTENCODING_SYMBOL encoding,
// even if charset is OEM_CHARSET/DEFAULT_CHARSET in WMF
LOGFONTW logfontw;
emfio::LOGFONTW logfontw;
logfontw.lfHeight = 0;
logfontw.lfWidth = 0;
logfontw.lfEscapement = 0;
......@@ -260,7 +261,7 @@ void WmfTest::testTdf99402()
logfontw.lfPitchAndFamily = FF_ROMAN | DEFAULT_PITCH;
logfontw.alfFaceName = "Symbol";
WinMtfFontStyle fontStyle(logfontw);
emfio::WinMtfFontStyle fontStyle(logfontw);
CPPUNIT_ASSERT_EQUAL(RTL_TEXTENCODING_SYMBOL, fontStyle.aFont.GetCharSet());
}
......
......@@ -113,7 +113,7 @@ namespace emfio
uno::Sequence< uno::Reference< ::graphic::XPrimitive2D > > XEmfParser::getDecomposition(
const uno::Reference< ::io::XInputStream >& xEmfStream,
const OUString& aAbsolutePath,
const OUString& /*aAbsolutePath*/,
const uno::Sequence< ::beans::PropertyValue >& rProperties)
{
drawinglayer::primitive2d::Primitive2DContainer aRetval;
......
......@@ -83,7 +83,7 @@ namespace drawinglayer
virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const override;
/// from MetafileAccessor
virtual bool accessMetafile(GDIMetaFile& rTargetMetafile) const;
virtual bool accessMetafile(GDIMetaFile& rTargetMetafile) const override;
/// provide unique ID
DeclPrimitive2DIDBlock()
......
......@@ -151,7 +151,6 @@ $(eval $(call gb_Module_add_check_targets,vcl,\
CppunitTest_vcl_mapmode \
CppunitTest_vcl_outdev \
CppunitTest_vcl_app_test \
$(if $(MERGELIBS),,CppunitTest_vcl_wmf_test) \
CppunitTest_vcl_jpeg_read_write_test \
CppunitTest_vcl_svm_test \
CppunitTest_vcl_pdfexport \
......
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