From ee1bf7e933dd858e9c6a6ec6bd38b31076413821 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Mon, 29 Apr 2019 07:54:30 +0900 Subject: Add LineColor,FillColor,OverlineColor to the SVM test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id130dd7739b9662541b50b7792da170da70a6a9b Reviewed-on: https://gerrit.libreoffice.org/71496 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- vcl/qa/cppunit/svm/svmtest.cxx | 71 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 6 deletions(-) (limited to 'vcl/qa') diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx index 7fbd73166e77..541822ef25e6 100644 --- a/vcl/qa/cppunit/svm/svmtest.cxx +++ b/vcl/qa/cppunit/svm/svmtest.cxx @@ -123,10 +123,10 @@ class SvmTest : public test::BootstrapFixture, public XmlTestTools //void checkMoveClipRegion(const GDIMetaFile& rMetaFile); void testMoveClipRegion(); - //void checkLineColor(const GDIMetaFile& rMetaFile); + void checkLineColor(const GDIMetaFile& rMetaFile); void testLineColor(); - //void checkFillColor(const GDIMetaFile& rMetaFile); + void checkFillColor(const GDIMetaFile& rMetaFile); void testFillColor(); void checkTextColor(const GDIMetaFile& rMetaFile); @@ -138,7 +138,7 @@ class SvmTest : public test::BootstrapFixture, public XmlTestTools void checkTextLineColor(const GDIMetaFile& rMetaFile); void testTextLineColor(); - //void checkOverLineColor(const GDIMetaFile& rMetaFile); + void checkOverLineColor(const GDIMetaFile& rMetaFile); void testOverLineColor(); //void checkTextAlign(const GDIMetaFile& rMetaFile); @@ -1308,10 +1308,50 @@ void SvmTest::testIntersectRegionClipRegion() {} void SvmTest::testMoveClipRegion() {} + +void SvmTest::checkLineColor(const GDIMetaFile& rMetaFile) +{ + xmlDocPtr pDoc = dumpMeta(rMetaFile); + + assertXPathAttrs(pDoc, "/metafile/push/linecolor[1]", { + {"color", "#654321"}, + }); +} + void SvmTest::testLineColor() -{} +{ + GDIMetaFile aGDIMetaFile; + ScopedVclPtrInstance pVirtualDev; + setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile); + + pVirtualDev->Push(); + pVirtualDev->SetLineColor(Color(0x654321)); + pVirtualDev->Pop(); + + checkLineColor(writeAndRead(aGDIMetaFile, "linecolor.svm")); +} + +void SvmTest::checkFillColor(const GDIMetaFile& rMetaFile) +{ + xmlDocPtr pDoc = dumpMeta(rMetaFile); + + assertXPathAttrs(pDoc, "/metafile/push/fillcolor[1]", { + {"color", "#456789"}, + }); +} + void SvmTest::testFillColor() -{} +{ + GDIMetaFile aGDIMetaFile; + ScopedVclPtrInstance pVirtualDev; + setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile); + + pVirtualDev->Push(); + pVirtualDev->SetFillColor(Color(0x456789)); + pVirtualDev->Pop(); + + checkFillColor(writeAndRead(aGDIMetaFile, "fillcolor.svm")); +} void SvmTest::checkTextColor(const GDIMetaFile& rMetaFile) { @@ -1373,8 +1413,27 @@ void SvmTest::testTextLineColor() checkTextLineColor(writeAndRead(aGDIMetaFile, "textlinecolor.svm")); } +void SvmTest::checkOverLineColor(const GDIMetaFile& rMetaFile) +{ + xmlDocPtr pDoc = dumpMeta(rMetaFile); + + assertXPathAttrs(pDoc, "/metafile/push/overlinecolor[1]", { + {"color", "#345678"}, + }); +} + void SvmTest::testOverLineColor() -{} +{ + GDIMetaFile aGDIMetaFile; + ScopedVclPtrInstance pVirtualDev; + setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile); + + pVirtualDev->Push(); + pVirtualDev->SetOverlineColor(Color(0x345678)); + pVirtualDev->Pop(); + + checkOverLineColor(writeAndRead(aGDIMetaFile, "overlinecolor.svm")); +} void SvmTest::testTextAlign() {} -- cgit