[Libreoffice-commits] core.git: sd/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 24 08:24:21 UTC 2020


 sd/qa/unit/data/odp/tdf136949.odp |binary
 sd/qa/unit/layout-tests.cxx       |   22 ++++++++++++++++++++++
 2 files changed, 22 insertions(+)

New commits:
commit 1e0ac737e620a6a3e5c54021c77f299e89e3a9ef
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Sep 24 00:31:35 2020 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Thu Sep 24 10:23:41 2020 +0200

    tdf#136949: sd_layout_tests: Add unittest
    
    Change-Id: I1f0bf54f4d4207cf23c40bf26b1c977152912c8e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103286
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sd/qa/unit/data/odp/tdf136949.odp b/sd/qa/unit/data/odp/tdf136949.odp
new file mode 100644
index 000000000000..91f3017d4dae
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf136949.odp differ
diff --git a/sd/qa/unit/layout-tests.cxx b/sd/qa/unit/layout-tests.cxx
index d6643f82420a..953500dc25a2 100644
--- a/sd/qa/unit/layout-tests.cxx
+++ b/sd/qa/unit/layout-tests.cxx
@@ -12,10 +12,12 @@ class SdLayoutTest : public SdModelTestBaseXML
 {
 public:
     void testTdf104722();
+    void testTdf136949();
 
     CPPUNIT_TEST_SUITE(SdLayoutTest);
 
     CPPUNIT_TEST(testTdf104722);
+    CPPUNIT_TEST(testTdf136949);
 
     CPPUNIT_TEST_SUITE_END();
 };
@@ -41,6 +43,26 @@ void SdLayoutTest::testTdf104722()
     xDocShRef->DoClose();
 }
 
+void SdLayoutTest::testTdf136949()
+{
+    sd::DrawDocShellRef xDocShRef
+        = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf136949.odp"), ODP);
+
+    std::shared_ptr<GDIMetaFile> xMetaFile = xDocShRef->GetPreviewMetaFile();
+    MetafileXmlDump dumper;
+
+    xmlDocUniquePtr pXmlDoc = XmlTestTools::dumpAndParse(dumper, *xMetaFile);
+    CPPUNIT_ASSERT(pXmlDoc);
+
+    // Without the fix in place, this test would have failed with
+    // - Expected: 13687
+    // - Actual  : 2832
+    assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[7]/polyline/point[1]", "x", "13687");
+    assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[7]/polyline/point[2]", "x", "24759");
+
+    xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdLayoutTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();


More information about the Libreoffice-commits mailing list