diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-01-17 13:29:44 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-01-18 18:12:10 +0100 |
commit | 55abb2c6bb8f554ceb2fe85ba873b9be7d6633ea (patch) | |
tree | ffca2f32a598419e82ee5bcf9396419ae4e6a68a /sc | |
parent | these two variables don't need to be static (diff) | |
download | core-55abb2c6bb8f554ceb2fe85ba873b9be7d6633ea.tar.gz core-55abb2c6bb8f554ceb2fe85ba873b9be7d6633ea.zip |
correctly terminate tableautoformatfield
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/extras/tableautoformatfield.cxx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sc/qa/extras/tableautoformatfield.cxx b/sc/qa/extras/tableautoformatfield.cxx index c4f596264bd4..ac0ad8c53692 100644 --- a/sc/qa/extras/tableautoformatfield.cxx +++ b/sc/qa/extras/tableautoformatfield.cxx @@ -34,10 +34,15 @@ namespace ScAutoFormatFieldObj { +#define NUMBER_OF_TESTS 2 + class ScTableAutoFormatField : public UnoApiTest { public: + virtual void setUp(); + virtual void tearDown(); + uno::Reference< beans::XPropertySet > init(); void testRotateReference(); void testVertJustify(); @@ -46,8 +51,13 @@ public: CPPUNIT_TEST(testVertJustify); CPPUNIT_TEST_SUITE_END(); +private: + + static int nTest; }; +int ScTableAutoFormatField::nTest = 0; + uno::Reference< beans::XPropertySet > ScTableAutoFormatField::init() { uno::Reference< container::XIndexAccess > xAutoFormatFields( m_xSFactory->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.TableAutoFormats"))), UNO_QUERY_THROW ); @@ -95,6 +105,23 @@ void ScTableAutoFormatField::testVertJustify() CPPUNIT_ASSERT_MESSAGE("value has not been changed", aValue == 3); } +void ScTableAutoFormatField::setUp() +{ + nTest += 1; + UnoApiTest::setUp(); +} + +void ScTableAutoFormatField::tearDown() +{ + UnoApiTest::tearDown(); + + if (nTest == NUMBER_OF_TESTS) + { + mxDesktop->terminate(); + uno::Reference< lang::XComponent>(m_xContext, UNO_QUERY_THROW)->dispose(); + } +} + CPPUNIT_TEST_SUITE_REGISTRATION(ScTableAutoFormatField); CPPUNIT_PLUGIN_IMPLEMENT(); |