From d833ab988bab6ca1a239c045eb236cafddda0e73 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 20 Mar 2020 10:48:44 +0100 Subject: Extract testDisposedByDesktopTerminate from CppunitTest_sw_apitests It is not guaranteed that SwXTextTable runs last during CppunitTest_sw_apitests, and e.g. building with --enable-lto on Linux caused SwXTextField to be run after SwXTextTable. But then testDisposedByDesktopTerminate had already shut down all the relevant global state, so the SwXTextField tests would fail. TerminateTest is a faithful copy of the original SwXTextTable testDisposedByDesktopTerminate behavior, but I do not know how much of that (if anything at all) is actually test-worthy. (For example, parts of TerminateTest::init may not be relevant, or the original SwXTextTable testDisposedByDesktopTerminate may even only have been there to clean up after other tests and not to actually test anything by itself, cf. 20ed81fd42cf8079c11c2b18973b9504a679e49c "Make individual tests clean up after themselves".) Change-Id: Ib95b7fa6888f55a27236a779c453a6d04122a527 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90774 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- sw/qa/api/SwXTextTable.cxx | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'sw/qa/api/SwXTextTable.cxx') diff --git a/sw/qa/api/SwXTextTable.cxx b/sw/qa/api/SwXTextTable.cxx index ed1bc0670251..37c8600653a4 100644 --- a/sw/qa/api/SwXTextTable.cxx +++ b/sw/qa/api/SwXTextTable.cxx @@ -44,7 +44,6 @@ struct SwXTextTable final : public test::BootstrapFixture, CPPUNIT_TEST_SUITE(SwXTextTable); CPPUNIT_TEST(testAddEventListener); CPPUNIT_TEST(testRemoveEventListener); - CPPUNIT_TEST(testDisposedByDesktopTerminate); CPPUNIT_TEST_SUITE_END(); private: @@ -62,13 +61,7 @@ void SwXTextTable::tearDown() { if (component_.is()) { - try - { - component_->dispose(); - } - catch (css::lang::DisposedException&) // thrown by testDisposedByDesktopTerminate - { - } + component_->dispose(); } } -- cgit