[Libreoffice-commits] core.git: 2 commits - vcl/qa
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Mon Apr 29 01:54:02 UTC 2019
vcl/qa/cppunit/svm/svmtest.cxx | 102 +++++++++++++++++++++++++++++++++++++----
1 file changed, 94 insertions(+), 8 deletions(-)
New commits:
commit ee1bf7e933dd858e9c6a6ec6bd38b31076413821
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon Apr 29 07:54:30 2019 +0900
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Mon Apr 29 03:53:20 2019 +0200
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 at gmail.com>
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()
{}
commit 565870dc8748e3fa578f070b1f5f152843a210f1
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon Apr 29 07:51:53 2019 +0900
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Mon Apr 29 03:53:04 2019 +0200
Add MetaActionClipRegion to the SVM test
Change-Id: I51bd172cdd22d55a6800d1e74e38149874629f85
Reviewed-on: https://gerrit.libreoffice.org/71495
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx
index d8d9adf7b72b..7fbd73166e77 100644
--- a/vcl/qa/cppunit/svm/svmtest.cxx
+++ b/vcl/qa/cppunit/svm/svmtest.cxx
@@ -111,7 +111,7 @@ class SvmTest : public test::BootstrapFixture, public XmlTestTools
void checkWallpaper(const GDIMetaFile& rMetaFile);
void testWallpaper();
- //void checkClipRegion(const GDIMetaFile& rMetaFile);
+ void checkClipRegion(const GDIMetaFile& rMetaFile);
void testClipRegion();
//void checkIntersectRectClipRegion(const GDIMetaFile& rMetaFile);
@@ -1273,8 +1273,35 @@ void SvmTest::testWallpaper()
checkWallpaper(writeAndRead(aGDIMetaFile, "wallpaper.svm"));
}
+void SvmTest::checkClipRegion(const GDIMetaFile& rMetaFile)
+{
+ xmlDocPtr pDoc = dumpMeta(rMetaFile);
+
+ assertXPathAttrs(pDoc, "/metafile/clipregion[1]", {
+ {"left", "2"},
+ {"top", "2"},
+ {"right", "5"},
+ {"bottom", "5"},
+ });
+}
+
void SvmTest::testClipRegion()
-{}
+{
+ GDIMetaFile aGDIMetaFile;
+ ScopedVclPtrInstance<VirtualDevice> pVirtualDev;
+ setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile);
+
+ vcl::Region aRegion(tools::Rectangle(Point(2, 2), Size(4, 4)));
+
+ // TODO
+ // explicit Region(const tools::Polygon& rPolygon);
+ // explicit Region(const tools::PolyPolygon& rPolyPoly);
+ // explicit Region(const basegfx::B2DPolyPolygon&);
+ pVirtualDev->SetClipRegion(aRegion);
+
+ checkClipRegion(writeAndRead(aGDIMetaFile, "clipregion.svm"));
+}
+
void SvmTest::testIntersectRectClipRegion()
{}
void SvmTest::testIntersectRegionClipRegion()
More information about the Libreoffice-commits
mailing list