[Libreoffice-commits] core.git: sw/CppunitTest_sw_tox.mk sw/qa

Stephan Bergmann sbergman at redhat.com
Thu Jun 19 05:29:11 PDT 2014


 sw/CppunitTest_sw_tox.mk                    |   30 +++++++++++++++++++++-------
 sw/qa/cppunit/tox/test_ToxLinkProcessor.cxx |   11 ++++++++--
 2 files changed, 32 insertions(+), 9 deletions(-)

New commits:
commit f741a60511707989cfd6b2c3a56ded22ffdc5b67
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Jun 19 14:24:49 2014 +0200

    ToxLinkProcessorTest needs SwGlobals::ensure to set pSwResMgr
    
    ...derefernced in
    
    (anonymous namespace)::lcl_NewUINameArray
    SwStyleNameMapper::GetChrFmtUINameArray
    SwStyleNameMapper::getNameFromId
    SwStyleNameMapper::fillNameFromId
    SwStyleNameMapper::FillUIName
    SwFmtINetFmt::SwFmtINetFmt
    sw::ToxLinkProcessor::ClosedLink::ClosedLink
    sw::ToxLinkProcessor::CloseLink
    ToxLinkProcessorTest::ExceptionIsThrownIfTooManyLinksAreClosed
    ...
    
    Also, fix the name from sw_tox_test to sw_tox.
    
    Change-Id: I48ea9fb6322df3725b089538fd67b2e24578b668

diff --git a/sw/CppunitTest_sw_tox.mk b/sw/CppunitTest_sw_tox.mk
index 23c61fe..960e94b 100644
--- a/sw/CppunitTest_sw_tox.mk
+++ b/sw/CppunitTest_sw_tox.mk
@@ -10,22 +10,22 @@
 # This file contains the unit test definition for class in the sources/core/tox subfolder
 # The macro which defines the main method is contained in test_ToxWhitespaceStripper.cxx
 
-$(eval $(call gb_CppunitTest_CppunitTest,sw_tox_test))
+$(eval $(call gb_CppunitTest_CppunitTest,sw_tox))
 
-$(eval $(call gb_CppunitTest_add_exception_objects,sw_tox_test, \
+$(eval $(call gb_CppunitTest_add_exception_objects,sw_tox, \
 	sw/qa/cppunit/tox/test_ToxWhitespaceStripper \
 	sw/qa/cppunit/tox/test_ToxLinkProcessor \
 	sw/qa/cppunit/tox/test_ToxTextGenerator \
 ))
 
-$(eval $(call gb_CppunitTest_use_libraries,sw_tox_test, \
+$(eval $(call gb_CppunitTest_use_libraries,sw_tox, \
 	comphelper \
 	cppu \
 	cppuhelper \
 	editeng \
 	sal \
 	svt \
-	sw \
+	svx \
 	test \
 	unotest \
 	vcl \
@@ -34,17 +34,33 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_tox_test, \
 	$(gb_UWINAPI) \
 ))
 
-$(eval $(call gb_CppunitTest_use_externals,sw_tox_test, \
+$(eval $(call gb_CppunitTest_use_library_objects,sw_tox, \
+	sw \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,sw_tox, \
 	boost_headers \
 	libxml2 \
 ))
 
-$(eval $(call gb_CppunitTest_use_api,sw_tox_test,\
+$(eval $(call gb_CppunitTest_use_api,sw_tox,\
 	offapi \
 	udkapi \
 ))
 
-$(eval $(call gb_CppunitTest_set_include,sw_tox_test,\
+$(eval $(call gb_CppunitTest_use_components,sw_tox, \
+	configmgr/source/configmgr \
+	framework/util/fwk \
+	i18npool/util/i18npool \
+	ucb/source/core/ucb1 \
+	ucb/source/ucp/file/ucpfile1 \
+))
+
+$(eval $(call gb_CppunitTest_use_configuration,sw_tox))
+$(eval $(call gb_CppunitTest_use_ure,sw_tox))
+$(eval $(call gb_CppunitTest_use_vcl,sw_tox))
+
+$(eval $(call gb_CppunitTest_set_include,sw_tox,\
     -I$(SRCDIR)/sw/inc \
     -I$(SRCDIR)/sw/source/core/inc \
     $$(INCLUDE) \
diff --git a/sw/qa/cppunit/tox/test_ToxLinkProcessor.cxx b/sw/qa/cppunit/tox/test_ToxLinkProcessor.cxx
index 1873bb1..e0ae1a1 100644
--- a/sw/qa/cppunit/tox/test_ToxLinkProcessor.cxx
+++ b/sw/qa/cppunit/tox/test_ToxLinkProcessor.cxx
@@ -16,13 +16,15 @@
 #include <ToxLinkProcessor.hxx>
 
 #include <cppunit/TestAssert.h>
-#include <cppunit/TestFixture.h>
 #include <cppunit/extensions/HelperMacros.h>
 #include <cppunit/plugin/TestPlugIn.h>
+#include <test/bootstrapfixture.hxx>
+
+#include <swdll.hxx>
 
 using namespace sw;
 
-class ToxLinkProcessorTest : public CppUnit::TestFixture
+class ToxLinkProcessorTest : public test::BootstrapFixture
 {
     void ExceptionIsThrownIfTooManyLinksAreClosed();
     void AddingAndClosingTwoLinksResultsInTwoClosedLinks();
@@ -36,6 +38,11 @@ class ToxLinkProcessorTest : public CppUnit::TestFixture
     CPPUNIT_TEST(LinkSequenceIsPreserved);
     CPPUNIT_TEST_SUITE_END();
 public:
+    void setUp() SAL_OVERRIDE {
+        BootstrapFixture::setUp();
+        SwGlobals::ensure();
+    }
+
     static const OUString STYLE_NAME_1;
     static const OUString STYLE_NAME_2;
     static const sal_uInt16 POOL_ID_1;


More information about the Libreoffice-commits mailing list