diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-04-11 21:53:33 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-04-11 21:53:33 -0400 |
commit | a9448bd1b7b64eff74198ead63154ae132ed853b (patch) | |
tree | 56f2dc65b63a3a3710f5f969702964d2c51afed0 /editeng | |
parent | 1bcd2c94930c95c1807c6112559f5b0041aeb4fa (diff) |
Avoid duplicate symbols & use setUp() and tearDown() for the item pool.
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/CppunitTest_editeng_core.mk | 1 | ||||
-rw-r--r-- | editeng/qa/unit/core-test.cxx | 30 |
2 files changed, 26 insertions, 5 deletions
diff --git a/editeng/CppunitTest_editeng_core.mk b/editeng/CppunitTest_editeng_core.mk index c94ff95e417f..90117c8d386d 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 e5c556fea151..b8e31119f9eb 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); |