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

This commit is contained in:
Kohei Yoshida
2012-04-11 21:53:33 -04:00
parent 1bcd2c9493
commit a9448bd1b7
2 changed files with 26 additions and 5 deletions
-1
View File
@@ -42,7 +42,6 @@ $(eval $(call gb_CppunitTest_use_libraries,editeng_core, \
comphelper \
cppu \
cppuhelper \
editeng \
i18nisolang1 \
i18nutil \
lng \
+26 -4
View File
@@ -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);