summaryrefslogtreecommitdiff
path: root/libreofficekit
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej.hunt@collabora.com>2014-07-31 10:07:39 +0200
committerAndrzej Hunt <andrzej.hunt@collabora.com>2014-07-31 12:31:37 +0200
commite780c96e8d5e6ad6142f328fa850fedb59f5ca97 (patch)
treecf238f08ee1c57b85d4cf7f0783b70148826a072 /libreofficekit
parentd6fd97b4c90625b59f96d0017790eb2e2c996e49 (diff)
Use one test instance to run all LOK tests.
Recreating Office instances after destruction (when still within the same process) currently fails, hence we need to do all tests at once for now. Change-Id: Ic7652c909e1cd970fe1ee76995e61fb6aae8f96c
Diffstat (limited to 'libreofficekit')
-rw-r--r--libreofficekit/qa/unit/tiledrendering.cxx25
1 files changed, 18 insertions, 7 deletions
diff --git a/libreofficekit/qa/unit/tiledrendering.cxx b/libreofficekit/qa/unit/tiledrendering.cxx
index 0d4aa95a8c31..74e063447cab 100644
--- a/libreofficekit/qa/unit/tiledrendering.cxx
+++ b/libreofficekit/qa/unit/tiledrendering.cxx
@@ -42,13 +42,28 @@ public:
TiledRenderingTest() {}
- void testOverlay();
+ // Currently it isn't possible to do multiple startup/shutdown
+ // cycle of LOK in a single process -- hence we run all our tests
+ // as one test, which simply carries out the individual test
+ // components on the one Office instance that we retrieve.
+ void runAllTests();
+
+ void testOverlay( Office* pOffice );
CPPUNIT_TEST_SUITE(TiledRenderingTest);
- CPPUNIT_TEST(testOverlay);
+ CPPUNIT_TEST(runAllTests);
CPPUNIT_TEST_SUITE_END();
};
+void TiledRenderingTest::runAllTests()
+{
+ scoped_ptr< Office > pOffice( lok_cpp_init(
+ m_sLOPath.c_str() ) );
+ CPPUNIT_ASSERT( pOffice.get() );
+
+ testOverlay( pOffice.get() );
+}
+
// Our dumped .png files end up in
// workdir/CppunitTest/libreofficekit_tiledrendering.test.core
@@ -66,7 +81,7 @@ static void dumpRGBABitmap( const OUString& rPath, const unsigned char* pBuffer,
sOutput.Close();
}
-void TiledRenderingTest::testOverlay()
+void TiledRenderingTest::testOverlay( Office* pOffice )
{
const string sDocPath = m_sSrcRoot + "/odk/examples/java/DocumentHandling/test/test1.odt";
const string sLockFile = m_sSrcRoot + "/odk/examples/java/DocumentHandling/test/.~lock.test1.odt#";
@@ -77,10 +92,6 @@ void TiledRenderingTest::testOverlay()
// Hence forcefully remove it here.
remove( sLockFile.c_str() );
- scoped_ptr< Office > pOffice( lok_cpp_init(
- m_sLOPath.c_str() ) );
- CPPUNIT_ASSERT( pOffice.get() );
-
scoped_ptr< Document> pDocument( pOffice->documentLoad(
sDocPath.c_str() ) );