[Libreoffice-commits] .: starmath/qa
Caolán McNamara
caolan at kemper.freedesktop.org
Tue Dec 7 07:42:48 PST 2010
starmath/qa/cppunit/test_starmath.cxx | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
New commits:
commit 4fcbcdd470f8394adf0bea5d783f3e7bf42fe583
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Dec 7 15:42:38 2010 +0000
setUp and tearDown are called on *every* test
diff --git a/starmath/qa/cppunit/test_starmath.cxx b/starmath/qa/cppunit/test_starmath.cxx
index 0cfadd0..46b1296 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);
}
More information about the Libreoffice-commits
mailing list