diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-02-13 14:35:33 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-02-15 08:36:05 +0100 |
commit | a04a555497b054e83bc7c8462ba342286508d3a5 (patch) | |
tree | 805edecaba4af296a0a17b5db0c9bcac028e5577 /sw/qa/extras/fodfexport | |
parent | 39fa034db32fa07a7f2a7afe77f7d1c047b5cad8 (diff) |
UnoApiXmlTest: factor out common code
Change-Id: I5c7f76b61a0dab8b4ebd1ac4680a7c25f982680c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163307
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163376
Diffstat (limited to 'sw/qa/extras/fodfexport')
-rw-r--r-- | sw/qa/extras/fodfexport/fodfexport.cxx | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/sw/qa/extras/fodfexport/fodfexport.cxx b/sw/qa/extras/fodfexport/fodfexport.cxx index 2cf5bf42a7c9..840b5d47ba8a 100644 --- a/sw/qa/extras/fodfexport/fodfexport.cxx +++ b/sw/qa/extras/fodfexport/fodfexport.cxx @@ -20,34 +20,38 @@ public: } }; -DECLARE_FODFEXPORT_TEST(testTdf113696, "tdf113696.odt") +CPPUNIT_TEST_FIXTURE(Test, testTdf113696) { + loadFromFile(u"tdf113696.odt"); + CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); + + save("OpenDocument Text Flat XML"); // Test that an image which is written in svm format (image/x-vclgraphic) // is accompanied by a png fallback graphic. - if (xmlDocUniquePtr pXmlDoc = parseExportedFile()) - { - assertXPath(pXmlDoc, "/office:document/office:body/office:text/text:p/draw:frame/" - "draw:image[@draw:mime-type='image/x-vclgraphic']"_ostr); - assertXPath(pXmlDoc, "/office:document/office:body/office:text/text:p/draw:frame/" - "draw:image[@draw:mime-type='image/png']"_ostr); - } + xmlDocUniquePtr pXmlDoc = parseExportedFile(); + assertXPath(pXmlDoc, "/office:document/office:body/office:text/text:p/draw:frame/" + "draw:image[@draw:mime-type='image/x-vclgraphic']"_ostr); + assertXPath(pXmlDoc, "/office:document/office:body/office:text/text:p/draw:frame/" + "draw:image[@draw:mime-type='image/png']"_ostr); } -DECLARE_FODFEXPORT_TEST(testTdf113696WriterImage, "tdf113696-writerimage.odt") +CPPUNIT_TEST_FIXTURE(Test, testTdf113696WriterImage) { + loadFromFile(u"tdf113696-writerimage.odt"); + CPPUNIT_ASSERT_EQUAL(1, getShapes()); CPPUNIT_ASSERT_EQUAL(1, getPages()); + + save("OpenDocument Text Flat XML"); // Same as testTdf113696, but with a writer image instead of a draw image // (they use different code paths). - if (xmlDocUniquePtr pXmlDoc = parseExportedFile()) - { - assertXPath(pXmlDoc, "/office:document/office:body/office:text/text:p/draw:frame/" - "draw:image[@draw:mime-type='image/x-vclgraphic']"_ostr); - assertXPath(pXmlDoc, "/office:document/office:body/office:text/text:p/draw:frame/" - "draw:image[@draw:mime-type='image/png']"_ostr); - } + xmlDocUniquePtr pXmlDoc = parseExportedFile(); + assertXPath(pXmlDoc, "/office:document/office:body/office:text/text:p/draw:frame/" + "draw:image[@draw:mime-type='image/x-vclgraphic']"_ostr); + assertXPath(pXmlDoc, "/office:document/office:body/office:text/text:p/draw:frame/" + "draw:image[@draw:mime-type='image/png']"_ostr); } DECLARE_FODFEXPORT_TEST(testSvgImageRoundtrip, "SvgImageTest.fodt") |