sw/qa/extras/htmlexport/htmlexport.cxx | 35 ++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-)
New commits: commit 756254beedf2220a7602c81059ae1d70589072ac Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Tue Jun 6 20:27:21 2023 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Wed Jun 7 08:18:47 2023 +0200 CppunitTest_sw_htmlexport: avoid reqif magic in testReqIfOle2Odg Set the filter options explicitly, rather than inferring it from the test name. Change-Id: I2fad91a968940ebfd908dde5f312c81535f01599 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152686 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index 5713128b01b5..0f8d4497d793 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -986,19 +986,28 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testReqIfOle2) verify(); } -DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testReqIfOle2Odg, "reqif-ole-odg.xhtml") -{ - uno::Reference<text::XTextEmbeddedObjectsSupplier> xSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xObjects(xSupplier->getEmbeddedObjects(), - uno::UNO_QUERY); - uno::Reference<document::XEmbeddedObjectSupplier> xTextEmbeddedObject(xObjects->getByIndex(0), - uno::UNO_QUERY); - uno::Reference<lang::XServiceInfo> xObject(xTextEmbeddedObject->getEmbeddedObject(), - uno::UNO_QUERY); - // This failed, both import and export failed to handle OLE2 that contains - // just ODF. - CPPUNIT_ASSERT(xObject.is()); - CPPUNIT_ASSERT(xObject->supportsService("com.sun.star.drawing.DrawingDocument")); +CPPUNIT_TEST_FIXTURE(HtmlExportTest, testReqIfOle2Odg) +{ + auto verify = [this]() { + uno::Reference<text::XTextEmbeddedObjectsSupplier> xSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xObjects(xSupplier->getEmbeddedObjects(), + uno::UNO_QUERY); + uno::Reference<document::XEmbeddedObjectSupplier> xTextEmbeddedObject( + xObjects->getByIndex(0), uno::UNO_QUERY); + uno::Reference<lang::XServiceInfo> xObject(xTextEmbeddedObject->getEmbeddedObject(), + uno::UNO_QUERY); + // This failed, both import and export failed to handle OLE2 that contains + // just ODF. + CPPUNIT_ASSERT(xObject.is()); + CPPUNIT_ASSERT(xObject->supportsService("com.sun.star.drawing.DrawingDocument")); + }; + setImportFilterOptions("xhtmlns=reqif-xhtml"); + setImportFilterName("HTML (StarWriter)"); + createSwDoc("reqif-ole-odg.xhtml"); + verify(); + setFilterOptions("xhtmlns=reqif-xhtml"); + saveAndReload(mpFilter); + verify(); } DECLARE_HTMLEXPORT_TEST(testList, "list.html")