From 0581718d889a841afd5e4e23f6c61f273a081773 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 18 Nov 2016 14:12:02 +0100 Subject: Make sure swui's pSwResMgr is initialized in CppunitTest_sw_dialogs_test ...to avoid -fsanitize=null at > sw/source/uibase/dbui/dbtree.cxx:147:18: runtime error: reference binding to null pointer of type 'ResMgr' > #0 0x7fd408581b70 in SwDBTreeList::SwDBTreeList(vcl::Window*, long) sw/source/uibase/dbui/dbtree.cxx:147:18 > #1 0x7fd408594596 in VclPtr VclPtr::Create&, long&>(VclPtr&, long&) include/vcl/vclptr.hxx:138:46 > #2 0x7fd4085827d8 in makeSwDBTreeList sw/source/uibase/dbui/dbtree.cxx:156:1 > #3 0x7fd443044214 in VclBuilder::makeObject(vcl::Window*, rtl::OString const&, rtl::OString const&, std::__debug::map, std::allocator > >&) vcl/source/window/builder.cxx:1793:17 Change-Id: I02c5a0017b85254bf34f622b55f7db9d5d546b80 --- sw/qa/unit/sw-dialogs-test.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sw') diff --git a/sw/qa/unit/sw-dialogs-test.cxx b/sw/qa/unit/sw-dialogs-test.cxx index 74acd8cc304c..1fb4f7b57ae1 100644 --- a/sw/qa/unit/sw-dialogs-test.cxx +++ b/sw/qa/unit/sw-dialogs-test.cxx @@ -26,6 +26,7 @@ extern "C" { using Fn = SwAbstractDialogFactory * (*)(); } class SwDialogsTest : public ScreenshotTest { private: + css::uno::Reference component_; osl::Module libSwui_; /// helper method to populate KnownDialogs, called in setUp(). Needs to be @@ -61,6 +62,9 @@ SwDialogsTest::~SwDialogsTest() void SwDialogsTest::setUp() { ScreenshotTest::setUp(); + // Make sure the sw library's global pSwResMgr is initialized: + component_ = loadFromDesktop( + "private:factory/swriter", "com.sun.star.text.TextDocument"); // Make sure the swui library's global pSwResMgr is initialized // (alternatively to dynamically loading the library, SwCreateDialogFactory // could be declared in an include file and this CppunitTest link against -- cgit