summaryrefslogtreecommitdiff
path: root/sw/qa/extras/inc
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-11-19 18:07:28 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-11-19 18:27:29 +0100
commitcc27264466c372d83d9a37001919ec73f5c221b3 (patch)
tree7e4fa4370f6ee00db0458d60b05a08b46d9217b2 /sw/qa/extras/inc
parentd646612f99be91e0706e2f32ae8371a4e7019eb8 (diff)
CppunitTest_sw_ooxmlexport: speed this up a bit
We don't have too much testcases where we assert directly the resulting zipped XML files, but where we did, we actully invoked filter() 5 times, even if 3 times is enough, fix this. That causes the testcase to run in 1m24.754s (previously it was 1m30.278s). Additionally, at one case the XML result is an expected one, having matching testcase and manual results is always good. Change-Id: Ie905002b113bc84f1e517c35f14739f423fd8ea2
Diffstat (limited to 'sw/qa/extras/inc')
-rw-r--r--sw/qa/extras/inc/swmodeltestbase.hxx16
1 files changed, 11 insertions, 5 deletions
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index 79eb8af578ed..ba64155ae001 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -89,7 +89,11 @@ class SwModelTestBase : public test::BootstrapFixture, public unotest::MacrosTes
{
public:
SwModelTestBase(const char* pTestDocumentPath = "", const char* pFilter = "")
- : mpXmlBuffer(0), mpTestDocumentPath(pTestDocumentPath), mpFilter(pFilter)
+ : mpXmlBuffer(0),
+ mpTestDocumentPath(pTestDocumentPath),
+ mpFilter(pFilter),
+ m_nStartTime(0),
+ m_bExported(false)
{
}
@@ -419,12 +423,12 @@ protected:
uno::Sequence<beans::PropertyValue> aArgs(1);
aArgs[0].Name = "FilterName";
aArgs[0].Value <<= OUString::createFromAscii(pFilter);
- utl::TempFile aTempFile;
- aTempFile.EnableKillingFile();
- xStorable->storeToURL(aTempFile.GetURL(), aArgs);
+ m_aTempFile.EnableKillingFile();
+ xStorable->storeToURL(m_aTempFile.GetURL(), aArgs);
uno::Reference<lang::XComponent> xComponent(xStorable, uno::UNO_QUERY);
xComponent->dispose();
- mxComponent = loadFromDesktop(aTempFile.GetURL(), "com.sun.star.text.TextDocument");
+ m_bExported = true;
+ mxComponent = loadFromDesktop(m_aTempFile.GetURL(), "com.sun.star.text.TextDocument");
if (mpXmlBuffer)
{
xmlBufferFree(mpXmlBuffer);
@@ -478,6 +482,8 @@ protected:
void (T::*pMethod)();
};
sal_uInt32 m_nStartTime;
+ utl::TempFile m_aTempFile;
+ bool m_bExported; ///< Does m_aTempFile already contain something useful?
};
/**