diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2019-04-29 07:54:30 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2019-04-29 03:53:20 +0200 |
commit | ee1bf7e933dd858e9c6a6ec6bd38b31076413821 (patch) | |
tree | a7d19d1cc1a790785ed6cd8a1b8857fba60dbbea /vcl/qa | |
parent | 565870dc8748e3fa578f070b1f5f152843a210f1 (diff) |
Add LineColor,FillColor,OverlineColor to the SVM test
Change-Id: Id130dd7739b9662541b50b7792da170da70a6a9b
Reviewed-on: https://gerrit.libreoffice.org/71496
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/qa')
-rw-r--r-- | vcl/qa/cppunit/svm/svmtest.cxx | 71 |
1 files changed, 65 insertions, 6 deletions
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<VirtualDevice> 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<VirtualDevice> 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<VirtualDevice> pVirtualDev; + setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile); + + pVirtualDev->Push(); + pVirtualDev->SetOverlineColor(Color(0x345678)); + pVirtualDev->Pop(); + + checkOverLineColor(writeAndRead(aGDIMetaFile, "overlinecolor.svm")); +} void SvmTest::testTextAlign() {} |