diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-09-24 00:31:35 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-09-24 10:23:41 +0200 |
commit | 1e0ac737e620a6a3e5c54021c77f299e89e3a9ef (patch) | |
tree | e9d7f249ca274020649193de62bfe540f17c3377 /sd/qa | |
parent | 0dce53516011f5d2d9408501714e2b1865517119 (diff) |
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@libreoffice.org>
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/unit/data/odp/tdf136949.odp | bin | 0 -> 12555 bytes | |||
-rw-r--r-- | sd/qa/unit/layout-tests.cxx | 22 |
2 files changed, 22 insertions, 0 deletions
diff --git a/sd/qa/unit/data/odp/tdf136949.odp b/sd/qa/unit/data/odp/tdf136949.odp Binary files differnew file mode 100644 index 000000000000..91f3017d4dae --- /dev/null +++ b/sd/qa/unit/data/odp/tdf136949.odp 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(); |