desktop/qa/desktop_lib/test_desktop_lib.cxx | 17 +---------------- sd/qa/unit/tiledrendering/tiledrendering.cxx | 1 - 2 files changed, 1 insertion(+), 17 deletions(-)
New commits: commit 66d6bed63c6be5feb8952e83296c41f219cd443f Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> AuthorDate: Sun Nov 11 16:54:59 2018 -0500 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Wed Oct 2 19:46:45 2019 +0200 LOK: disable LOKit in unit-tests only after destroying all When we disable LOKit at the end of a unit-test, we do so before any of the smart-pointers go out of scope. These instances are then destroyed when LOKit is no longer active, in spite of the fact that they were created while it was. This leaves some dialog/window routing notifiers dangling, which cause assertion failures and access-after-free (when they are invoked on destruction inadvertently). The latter issue was found with 'make CppunitTest_sd_tiledrendering VALGRIND=memcheck'. The fix is to move these flags to the setup and teardown stages of cpp-unit. Change-Id: I50bc240b96026880a2e278ea530b1e1810b8e28d Reviewed-on: https://gerrit.libreoffice.org/80028 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.me...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/80056 Tested-by: Michael Meeks <michael.me...@collabora.com> diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index c08cdaeb41bc..d2e6b1890f97 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -71,6 +71,7 @@ public: comphelper::LibreOfficeKit::setActive(true); UnoApiTest::setUp(); + mxDesktop.set(frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory()))); SfxApplication::GetOrCreate(); }; @@ -2208,7 +2209,6 @@ void DesktopLOKTest::readFileIntoByteVector(OUString const & sFilename, std::vec void DesktopLOKTest::testGetSignatureState_Signed() { - comphelper::LibreOfficeKit::setActive(); LibLODocument_Impl* pDocument = loadDoc("signed.odt"); Scheduler::ProcessEventsToIdle(); pDocument->m_pDocumentClass->initializeForRendering(pDocument, "{}"); @@ -2236,7 +2236,6 @@ void DesktopLOKTest::testGetSignatureState_Signed() void DesktopLOKTest::testGetSignatureState_NonSigned() { - comphelper::LibreOfficeKit::setActive(); LibLODocument_Impl* pDocument = loadDoc("blank_text.odt"); Scheduler::ProcessEventsToIdle(); pDocument->m_pDocumentClass->initializeForRendering(pDocument, "{}"); @@ -2246,8 +2245,6 @@ void DesktopLOKTest::testGetSignatureState_NonSigned() void DesktopLOKTest::testInsertCertificate_DER_ODT() { - comphelper::LibreOfficeKit::setActive(); - // Load the document, save it into a temp file and load that file again LibLODocument_Impl* pDocument = loadDoc("blank_text.odt"); utl::TempFile aTempFile; @@ -2299,8 +2296,6 @@ void DesktopLOKTest::testInsertCertificate_DER_ODT() void DesktopLOKTest::testInsertCertificate_PEM_ODT() { - comphelper::LibreOfficeKit::setActive(); - // Load the document, save it into a temp file and load that file again LibLODocument_Impl* pDocument = loadDoc("blank_text.odt"); utl::TempFile aTempFile; @@ -2359,8 +2354,6 @@ void DesktopLOKTest::testInsertCertificate_PEM_ODT() void DesktopLOKTest::testInsertCertificate_PEM_DOCX() { - comphelper::LibreOfficeKit::setActive(); - // Load the document, save it into a temp file and load that file again LibLODocument_Impl* pDocument = loadDoc("blank_text.docx"); utl::TempFile aTempFile; @@ -2422,8 +2415,6 @@ void DesktopLOKTest::testSignDocument_PEM_PDF() // FIXME: needs investigation ... return; - comphelper::LibreOfficeKit::setActive(); - // Load the document, save it into a temp file and load that file again LibLODocument_Impl* pDocument = loadDoc("blank_text.odt"); utl::TempFile aTempFile; @@ -2480,8 +2471,6 @@ void DesktopLOKTest::testSignDocument_PEM_PDF() void DesktopLOKTest::testTextSelectionHandles() { - comphelper::LibreOfficeKit::setActive(); - LibLODocument_Impl* pDocument = loadDoc("blank_text.odt"); pDocument->pClass->registerCallback(pDocument, &DesktopLOKTest::callback, this); @@ -2521,7 +2510,6 @@ void DesktopLOKTest::testTextSelectionHandles() void DesktopLOKTest::testDialogPaste() { - comphelper::LibreOfficeKit::setActive(); LibLODocument_Impl* pDocument = loadDoc("blank_text.odt"); pDocument->pClass->postUnoCommand(pDocument, ".uno:HyperlinkDialog", nullptr, false); Scheduler::ProcessEventsToIdle(); @@ -2548,9 +2536,6 @@ void DesktopLOKTest::testDialogPaste() void DesktopLOKTest::testComplexSelection() { - // needed for SwTransferable to cope with the selection. - comphelper::LibreOfficeKit::setActive(); - // Start with a blank text file and add contents. LibLODocument_Impl* pDocument = loadDoc("blank_text.odt"); // LibLODocument_Impl* pDocument = loadDoc("sheet_with_image.ods"); diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 6a3837897bbb..0822d2b047e0 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -2186,7 +2186,6 @@ void SdTiledRenderingTest::testCutSelectionChange() void SdTiledRenderingTest::testInsertDeletePageInvalidation() { // Load the document. - comphelper::LibreOfficeKit::setActive(); SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp"); ViewCallback aView1; SfxViewShell::Current()->registerLibreOfficeKitViewCallback(&ViewCallback::callback, &aView1); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits