From 4c868602960a362edbea28a53535bdee4cfc2230 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Mon, 29 Apr 2019 07:57:23 +0900 Subject: Add MetaActionTransparent to the SVM test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia927070883e5647b61876e31d6a0a085e2456f8a Reviewed-on: https://gerrit.libreoffice.org/71498 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- vcl/qa/cppunit/svm/svmtest.cxx | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) (limited to 'vcl') diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx index 406eeb551360..a4cecaa12b14 100644 --- a/vcl/qa/cppunit/svm/svmtest.cxx +++ b/vcl/qa/cppunit/svm/svmtest.cxx @@ -156,7 +156,7 @@ class SvmTest : public test::BootstrapFixture, public XmlTestTools void checkRasterOp(const GDIMetaFile& rMetaFile); void testRasterOp(); - //void checkTransparent(const GDIMetaFile& rMetaFile); + void checkTransparent(const GDIMetaFile& rMetaFile); void testTransparent(); //void checkFloatTransparent(const GDIMetaFile& rMetaFile); @@ -1517,8 +1517,43 @@ void SvmTest::testRasterOp() checkRasterOp(writeAndRead(aGDIMetaFile, "rasterop.svm")); } +void SvmTest::checkTransparent(const GDIMetaFile& rMetaFile) +{ + xmlDocPtr pDoc = dumpMeta(rMetaFile); + + assertXPathAttrs(pDoc, "/metafile/transparent[1]", { + {"transparence", "50"}, + }); + + assertXPathAttrs(pDoc, "/metafile/transparent[1]/polygon/point[1]", { + {"x", "1"}, {"y", "8"}, + }); + assertXPathAttrs(pDoc, "/metafile/transparent[1]/polygon/point[2]", { + {"x", "2"}, {"y", "7"}, + }); + assertXPathAttrs(pDoc, "/metafile/transparent[1]/polygon/point[3]", { + {"x", "3"}, {"y", "6"}, + }); +} + void SvmTest::testTransparent() -{} +{ + GDIMetaFile aGDIMetaFile; + ScopedVclPtrInstance pVirtualDev; + setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile); + + tools::Polygon aPolygon(3); + aPolygon.SetPoint(Point(1, 8), 0); + aPolygon.SetPoint(Point(2, 7), 1); + aPolygon.SetPoint(Point(3, 6), 2); + + tools::PolyPolygon aPolyPolygon(1); + aPolyPolygon.Insert(aPolygon); + + pVirtualDev->DrawTransparent(aPolygon, 50); + + checkTransparent(writeAndRead(aGDIMetaFile, "transparent.svm")); +} void SvmTest::testFloatTransparent() {} -- cgit