[Libreoffice-commits] .: editeng/CppunitTest_editeng_core.mk editeng/qa

Kohei Yoshida kohei at kemper.freedesktop.org
Wed Apr 11 18:54:00 PDT 2012


 editeng/CppunitTest_editeng_core.mk |    1 -
 editeng/qa/unit/core-test.cxx       |   30 ++++++++++++++++++++++++++----
 2 files changed, 26 insertions(+), 5 deletions(-)

New commits:
commit a9448bd1b7b64eff74198ead63154ae132ed853b
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Wed Apr 11 21:53:33 2012 -0400

    Avoid duplicate symbols & use setUp() and tearDown() for the item pool.

diff --git a/editeng/CppunitTest_editeng_core.mk b/editeng/CppunitTest_editeng_core.mk
index c94ff95..90117c8 100644
--- a/editeng/CppunitTest_editeng_core.mk
+++ b/editeng/CppunitTest_editeng_core.mk
@@ -42,7 +42,6 @@ $(eval $(call gb_CppunitTest_use_libraries,editeng_core, \
     comphelper \
     cppu \
     cppuhelper \
-    editeng \
     i18nisolang1 \
     i18nutil \
     lng \
diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index e5c556f..b8e3111 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -49,20 +49,42 @@ class Test : public test::BootstrapFixture
 public:
     Test();
 
+    virtual void setUp();
+    virtual void tearDown();
+
     void testConstruction();
 
     CPPUNIT_TEST_SUITE(Test);
     CPPUNIT_TEST(testConstruction);
     CPPUNIT_TEST_SUITE_END();
+
+private:
+    EditEngineItemPool* mpItemPool;
 };
 
-Test::Test() {}
+Test::Test() : mpItemPool(NULL) {}
+
+void Test::setUp()
+{
+    test::BootstrapFixture::setUp();
+
+    mpItemPool = new EditEngineItemPool(true);
+}
+
+void Test::tearDown()
+{
+    SfxItemPool::Free(mpItemPool);
+
+    test::BootstrapFixture::tearDown();
+}
 
 void Test::testConstruction()
 {
-    EditEngineItemPool* pPool = new EditEngineItemPool(true);
-    EditEngine aEngine(pPool);
-    SfxItemPool::Free(pPool);
+    EditEngine aEngine(mpItemPool);
+
+    // TODO: This currently causes segfault in vcl.
+//  rtl::OUString aParaText = "I am Edit Engine.";
+//  aEngine.SetText(aParaText);
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);


More information about the Libreoffice-commits mailing list