summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2024-12-16 09:12:32 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2024-12-19 11:32:53 +0100
commita02f3eeffececfec5b43c4e5c4aa617fe4096176 (patch)
tree97941a156c58b31d0c6f4af25f29530a3ba76149
parent300f70ec4b56b64f7b23aac0bdbe9cca978189b2 (diff)
CppunitTest_sw_apitests: remove leftover myNewGroup2.bau before the test
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 <caolan.mcnamara@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178576 (cherry picked from commit 703cbc0bb75b0943cf5b95ff62c6fe4b4a028788) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178589 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
-rw-r--r--sw/qa/api/SwXAutoTextContainer.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/sw/qa/api/SwXAutoTextContainer.cxx b/sw/qa/api/SwXAutoTextContainer.cxx
index 4d6031a990e4..c87952f091fb 100644
--- a/sw/qa/api/SwXAutoTextContainer.cxx
+++ b/sw/qa/api/SwXAutoTextContainer.cxx
@@ -53,6 +53,15 @@ public:
Reference<text::XAutoTextContainer> 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<container::XNameAccess> xNA(xAutoTextContainer, UNO_QUERY_THROW);
Sequence<rtl::OUString> aNames = xNA->getElementNames();
std::cout << aNames[0] << std::endl;