summaryrefslogtreecommitdiff
path: root/libreofficekit
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej.hunt@collabora.com>2014-07-31 10:08:57 +0200
committerAndrzej Hunt <andrzej.hunt@collabora.com>2014-07-31 12:31:38 +0200
commitcc7f66dd53fd6b6c80134aa11fb4c00f95441f7c (patch)
tree61b4a56e1bf0ee95885674fafa3adadfe46b9aa3 /libreofficekit
parente780c96e8d5e6ad6142f328fa850fedb59f5ca97 (diff)
LOK: add slide name retrieval test.
Change-Id: I6d2bc4dfa634223da662af6f7c9a91f06cfe7534
Diffstat (limited to 'libreofficekit')
-rw-r--r--libreofficekit/qa/data/impress_slidenames.odpbin0 -> 15799 bytes
-rw-r--r--libreofficekit/qa/unit/tiledrendering.cxx23
2 files changed, 23 insertions, 0 deletions
diff --git a/libreofficekit/qa/data/impress_slidenames.odp b/libreofficekit/qa/data/impress_slidenames.odp
new file mode 100644
index 000000000000..d7cb6aeefbde
--- /dev/null
+++ b/libreofficekit/qa/data/impress_slidenames.odp
Binary files differ
diff --git a/libreofficekit/qa/unit/tiledrendering.cxx b/libreofficekit/qa/unit/tiledrendering.cxx
index 74e063447cab..c5446150c8d5 100644
--- a/libreofficekit/qa/unit/tiledrendering.cxx
+++ b/libreofficekit/qa/unit/tiledrendering.cxx
@@ -48,6 +48,7 @@ public:
// components on the one Office instance that we retrieve.
void runAllTests();
+ void testImpressSlideNames( Office* pOffice );
void testOverlay( Office* pOffice );
CPPUNIT_TEST_SUITE(TiledRenderingTest);
@@ -61,6 +62,7 @@ void TiledRenderingTest::runAllTests()
m_sLOPath.c_str() ) );
CPPUNIT_ASSERT( pOffice.get() );
+ testImpressSlideNames( pOffice.get() );
testOverlay( pOffice.get() );
}
@@ -81,6 +83,27 @@ static void dumpRGBABitmap( const OUString& rPath, const unsigned char* pBuffer,
sOutput.Close();
}
+void TiledRenderingTest::testImpressSlideNames( Office* pOffice )
+{
+ const string sDocPath = m_sSrcRoot + "/libreofficekit/qa/data/impress_slidenames.odp";
+ const string sLockFile = m_sSrcRoot +"/libreofficekit/qa/data/.~lock.impress_slidenames.odp#";
+
+ // FIXME: this is a temporary hack: LOK will fail when trying to open a
+ // locked file, and since we're reusing the file for a different unit
+ // test it's entirely possible that an unwanted lock file will remain.
+ // Hence forcefully remove it here.
+ remove( sLockFile.c_str() );
+
+ scoped_ptr< Document> pDocument( pOffice->documentLoad( sDocPath.c_str() ) );
+
+ CPPUNIT_ASSERT( pDocument->getParts() == 3 );
+ CPPUNIT_ASSERT( strcmp( pDocument->getPartName( 0 ), "TestText1" ) == 0 );
+ CPPUNIT_ASSERT( strcmp( pDocument->getPartName( 1 ), "TestText2" ) == 0 );
+ // The third slide hasn't had a name given to it (i.e. using the rename
+ // context menu in Impress), thus it should (as far as I can determine)
+ // have a localised version of "Slide 3".
+}
+
void TiledRenderingTest::testOverlay( Office* pOffice )
{
const string sDocPath = m_sSrcRoot + "/odk/examples/java/DocumentHandling/test/test1.odt";