From 0d16b0e351e455a87292fd7d7e0dc0f626d74b82 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 16 Dec 2024 09:12:32 +0100 Subject: CppunitTest_sw_apitests: remove leftover myNewGroup2.bau before the test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fails for me in a tree that runs 'make check' and there was a previous 'make check' previously. Seems the trouble is that we have this C++ test creating an autotext .bau file, but there is also a Java one, so if we're not lucky with the order of these, the C++ one will fail with its hardcoded "must be 3 .bau files in instdir" assertion. Fix the immediate problem by removing the test .bau file before running the C++ test. A better, but more complex fix would be to create the test .bau file in the user profile (and not in instdir) for both the Java and C++ cases, and then none of these tests would influece other tests during 'make check'. Change-Id: I536d769db733515ec6a7d41fd7dbf601c4b582d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178548 Reviewed-by: Caolán McNamara Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara --- sw/qa/api/SwXAutoTextContainer.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sw/qa/api/SwXAutoTextContainer.cxx b/sw/qa/api/SwXAutoTextContainer.cxx index 1f1fc3df1d49..7c116544d9bf 100644 --- a/sw/qa/api/SwXAutoTextContainer.cxx +++ b/sw/qa/api/SwXAutoTextContainer.cxx @@ -53,6 +53,15 @@ public: Reference xAutoTextContainer = text::AutoTextContainer::create(comphelper::getProcessComponentContext()); + try + { + // See qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java. + xAutoTextContainer->removeByName(u"myNewGroup2*1"_ustr); + } + catch (const container::NoSuchElementException&) + { + } + Reference xNA(xAutoTextContainer, UNO_QUERY_THROW); Sequence aNames = xNA->getElementNames(); std::cout << aNames[0] << std::endl; -- cgit