diff options
author | Caolán McNamara <caolanm@redhat.com> | 2010-12-07 15:42:38 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2010-12-07 15:42:38 +0000 |
commit | d69e5470aca43943bd3d540240ba40a01ebc74c5 (patch) | |
tree | 49e36fd28629f014c9ee5d7ffc50fb1e98e30334 /starmath/qa | |
parent | 78419248217f693905fff691da091ff62de63a15 (diff) |
setUp and tearDown are called on *every* test
Diffstat (limited to 'starmath/qa')
-rw-r--r-- | starmath/qa/cppunit/test_starmath.cxx | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/starmath/qa/cppunit/test_starmath.cxx b/starmath/qa/cppunit/test_starmath.cxx index 0cfadd035b0b..46b1296fdeb6 100644 --- a/starmath/qa/cppunit/test_starmath.cxx +++ b/starmath/qa/cppunit/test_starmath.cxx @@ -44,12 +44,14 @@ namespace { class Test : public CppUnit::TestFixture { public: + Test(); + ~Test(); + // init virtual void setUp(); virtual void tearDown(); // tests - void testDocument(); void tmEditUndoRedo(); void tmEditAllClipboard(); void tmEditMarker(); @@ -58,7 +60,11 @@ public: void tViewZoom(); CPPUNIT_TEST_SUITE(Test); - CPPUNIT_TEST(testDocument); + CPPUNIT_TEST(tmEditUndoRedo); + CPPUNIT_TEST(tmEditAllClipboard); + CPPUNIT_TEST(tmEditMarker); + CPPUNIT_TEST(tmEditFailure); + CPPUNIT_TEST(tViewZoom); CPPUNIT_TEST_SUITE_END(); private: @@ -73,7 +79,7 @@ private: SmViewShell *m_pViewShell; }; -void Test::setUp() +Test::Test() { m_xContext = cppu::defaultBootstrap_InitialComponentContext(); m_xFactory = m_xContext->getServiceManager(); @@ -88,7 +94,10 @@ void Test::setUp() InitVCL(xSM); SmDLL::Init(); +} +void Test::setUp() +{ m_xDocShRef = new SmDocShell( SFXMODEL_EMBEDDED_OBJECT | SFXMODEL_DISABLE_EMBEDDED_SCRIPTS | @@ -113,6 +122,10 @@ void Test::tearDown() delete m_pSmCmdBoxWindow; delete m_pDispatcher; m_xDocShRef.Clear(); +} + +Test::~Test() +{ uno::Reference< lang::XComponent >(m_xContext, uno::UNO_QUERY_THROW)->dispose(); } @@ -396,16 +409,6 @@ void Test::tViewZoom() } } -void Test::testDocument() -{ - tmEditUndoRedo(); - tmEditAllClipboard(); - tmEditMarker(); - tmEditFailure(); - - tViewZoom(); -} - CPPUNIT_TEST_SUITE_REGISTRATION(Test); } |