diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-10-20 13:39:02 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-10-20 18:02:10 +0200 |
commit | e36b151a5bfbd8a1e3e65e43ddbc082d5ca77a9c (patch) | |
tree | 5b48b55ea9825b93959d28b4af66823e4d6dfbb1 /sd | |
parent | 82b1bcf7d23d3795347fb45c09ea3c836c246bd3 (diff) |
tdf#128212: sd_layout_tests: Add unittest
Change-Id: I099969143a25db1a580be5057e136cf05721f270
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104560
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/odp/tdf128212.pptx | bin | 0 -> 16921 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/tdf128212.pptx b/sd/qa/unit/data/odp/tdf128212.pptx Binary files differnew file mode 100644 index 000000000000..52ba8ed0d81a --- /dev/null +++ b/sd/qa/unit/data/odp/tdf128212.pptx diff --git a/sd/qa/unit/layout-tests.cxx b/sd/qa/unit/layout-tests.cxx index 953500dc25a2..5fe1a5a4b6de 100644 --- a/sd/qa/unit/layout-tests.cxx +++ b/sd/qa/unit/layout-tests.cxx @@ -13,11 +13,13 @@ class SdLayoutTest : public SdModelTestBaseXML public: void testTdf104722(); void testTdf136949(); + void testTdf128212(); CPPUNIT_TEST_SUITE(SdLayoutTest); CPPUNIT_TEST(testTdf104722); CPPUNIT_TEST(testTdf136949); + CPPUNIT_TEST(testTdf128212); CPPUNIT_TEST_SUITE_END(); }; @@ -63,6 +65,26 @@ void SdLayoutTest::testTdf136949() xDocShRef->DoClose(); } +void SdLayoutTest::testTdf128212() +{ + sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf128212.pptx"), PPTX); + + 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: 7797 + // - Actual : 12068 + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray", "x", "4525"); + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray", "y", "7797"); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdLayoutTest); CPPUNIT_PLUGIN_IMPLEMENT(); |