vcl/qa/cppunit/svm/data/refpoint.svm |binary
 vcl/qa/cppunit/svm/svmtest.cxx       |   32 ++++++++++++++++++++++++++++++--
 2 files changed, 30 insertions(+), 2 deletions(-)

New commits:
commit 1adbb3e00593af8eed5baf7019fa9b177186567c
Author:     panoskorovesis <panoskorove...@outlook.com>
AuthorDate: Wed Jun 9 10:03:34 2021 +0300
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Wed Jun 9 15:47:53 2021 +0200

    Add RefPoint cppunit test to vcl
    
    The test creates two RefPoints. A default one and one
    using a Point. Then checks their attributes
    
    Change-Id: I7ae3d6498f776d00dee3d084d13f0764942af5c6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116780
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/vcl/qa/cppunit/svm/data/refpoint.svm 
b/vcl/qa/cppunit/svm/data/refpoint.svm
new file mode 100644
index 000000000000..e6412f9083b2
Binary files /dev/null and b/vcl/qa/cppunit/svm/data/refpoint.svm differ
diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx
index 06ec5841f8f6..0331502d1041 100644
--- a/vcl/qa/cppunit/svm/svmtest.cxx
+++ b/vcl/qa/cppunit/svm/svmtest.cxx
@@ -179,7 +179,7 @@ class SvmTest : public test::BootstrapFixture, public 
XmlTestTools
     //void checkEPS(const GDIMetaFile& rMetaFile);
     void testEPS();
 
-    //void checkRefPoint(const GDIMetaFile& rMetaFile);
+    void checkRefPoint(const GDIMetaFile& rMetaFile);
     void testRefPoint();
 
     //void checkComment(const GDIMetaFile& rMetaFile);
@@ -1636,8 +1636,36 @@ void SvmTest::testFloatTransparent()
 void SvmTest::testEPS()
 {}
 
+void SvmTest::checkRefPoint(const GDIMetaFile& rMetaFile)
+{
+    xmlDocUniquePtr pDoc = dumpMeta(rMetaFile);
+
+    assertXPathAttrs(pDoc, "/metafile/refpoint[1]", {
+        {"x", "0"},
+        {"y", "0"},
+        {"set", "false"}
+    });
+
+    assertXPathAttrs(pDoc, "/metafile/refpoint[2]", {
+        {"x", "1"},
+        {"y", "2"},
+        {"set", "true"}
+    });
+}
+
 void SvmTest::testRefPoint()
-{}
+{
+    GDIMetaFile aGDIMetaFile;
+    ScopedVclPtrInstance<VirtualDevice> pVirtualDev;
+    setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile);
+
+    pVirtualDev->SetRefPoint();
+
+    pVirtualDev->SetRefPoint(Point(1,2));
+
+    checkRefPoint(writeAndReadStream(aGDIMetaFile));
+    checkRefPoint(readFile(u"refpoint.svm"));
+}
 
 void SvmTest::testComment()
 {}
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to