summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2011-10-05 16:00:44 +0100
committerMichael Meeks <michael.meeks@suse.com>2011-10-05 16:02:28 +0100
commit8a0d0457a79836fa9d8ea8d4c48ecbf7bac2e95b (patch)
tree242935d062542ef2993a4e0bc3aeb3f188bef1a4 /sw
parent9767483eea7800aadd18b4489069ad633ce7a79c (diff)
test fix: use setUp and tearDown not constructors to init LibreOffice
It turns out the constructors are all run back-to-back one per filter, and we need to init and de-init in a sensible order to make multiple tests that otherwise share the ContentBroker work properly.
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/core/filters-test.cxx7
-rw-r--r--sw/qa/core/swdoc-test.cxx17
2 files changed, 9 insertions, 15 deletions
diff --git a/sw/qa/core/filters-test.cxx b/sw/qa/core/filters-test.cxx
index b59f1129ed03..84bb4be3f8fd 100644
--- a/sw/qa/core/filters-test.cxx
+++ b/sw/qa/core/filters-test.cxx
@@ -51,9 +51,8 @@ using namespace ::com::sun::star;
class SwFiltersTest : public test::FiltersTest
{
public:
- SwFiltersTest();
-
bool load(const rtl::OUString &rFilter, const rtl::OUString &rURL, const rtl::OUString &rUserData);
+ virtual void setUp();
// Ensure CVEs remain unbroken
void testCVEs();
@@ -91,8 +90,10 @@ void SwFiltersTest::testCVEs()
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CWW8")));
}
-SwFiltersTest::SwFiltersTest()
+void SwFiltersTest::setUp()
{
+ test::FiltersTest::setUp();
+
//This is a bit of a fudge, we do this to ensure that SwGlobals::ensure,
//which is a private symbol to us, gets called
m_xWriterComponent =
diff --git a/sw/qa/core/swdoc-test.cxx b/sw/qa/core/swdoc-test.cxx
index 992cf5bfc7b1..c3ec40d5998e 100644
--- a/sw/qa/core/swdoc-test.cxx
+++ b/sw/qa/core/swdoc-test.cxx
@@ -65,9 +65,6 @@ using namespace ::com::sun::star;
class SwDocTest : public test::BootstrapFixture
{
public:
- SwDocTest();
- ~SwDocTest();
-
virtual void setUp();
virtual void tearDown();
@@ -441,26 +438,22 @@ void SwDocTest::randomTest()
}
}
-SwDocTest::SwDocTest()
-{
- SwGlobals::ensure();
-}
-
void SwDocTest::setUp()
{
+ BootstrapFixture::setUp();
+
+ SwGlobals::ensure();
m_pDoc = new SwDoc;
m_xDocShRef = new SwDocShell(m_pDoc, SFX_CREATE_MODE_EMBEDDED);
m_xDocShRef->DoInitNew(0);
}
-SwDocTest::~SwDocTest()
-{
-}
-
void SwDocTest::tearDown()
{
m_xDocShRef.Clear();
delete m_pDoc;
+
+ BootstrapFixture::tearDown();
}
CPPUNIT_TEST_SUITE_REGISTRATION(SwDocTest);