summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libreofficekit/qa/data/blank_presentation.odpbin0 -> 15630 bytes
-rw-r--r--libreofficekit/qa/data/blank_text.odtbin0 -> 8295 bytes
-rw-r--r--libreofficekit/qa/unit/tiledrendering.cxx30
3 files changed, 30 insertions, 0 deletions
diff --git a/libreofficekit/qa/data/blank_presentation.odp b/libreofficekit/qa/data/blank_presentation.odp
new file mode 100644
index 000000000000..fd68d9a9b137
--- /dev/null
+++ b/libreofficekit/qa/data/blank_presentation.odp
Binary files differ
diff --git a/libreofficekit/qa/data/blank_text.odt b/libreofficekit/qa/data/blank_text.odt
new file mode 100644
index 000000000000..00b92d785acd
--- /dev/null
+++ b/libreofficekit/qa/data/blank_text.odt
Binary files differ
diff --git a/libreofficekit/qa/unit/tiledrendering.cxx b/libreofficekit/qa/unit/tiledrendering.cxx
index c5446150c8d5..043ffafcd63c 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 testDocumentTypes( Office* pOffice );
void testImpressSlideNames( Office* pOffice );
void testOverlay( Office* pOffice );
@@ -62,6 +63,7 @@ void TiledRenderingTest::runAllTests()
m_sLOPath.c_str() ) );
CPPUNIT_ASSERT( pOffice.get() );
+ testDocumentTypes( pOffice.get() );
testImpressSlideNames( pOffice.get() );
testOverlay( pOffice.get() );
}
@@ -83,6 +85,34 @@ static void dumpRGBABitmap( const OUString& rPath, const unsigned char* pBuffer,
sOutput.Close();
}
+LibreOfficeKitDocumentType getDocumentType( Office* pOffice, const string& rPath )
+{
+ scoped_ptr< Document> pDocument( pOffice->documentLoad( rPath.c_str() ) );
+ CPPUNIT_ASSERT( pDocument.get() );
+ return pDocument->getDocumentType();
+}
+
+void TiledRenderingTest::testDocumentTypes( Office* pOffice )
+{
+ const string sTextDocPath = m_sSrcRoot + "/libreofficekit/qa/data/blank_text.odt";
+ const string sTextLockFile = m_sSrcRoot +"/libreofficekit/qa/data/.~lock.blank_text.odt#";
+
+ // FIXME: same comment as below wrt lockfile removal.
+ remove( sTextLockFile.c_str() );
+
+ CPPUNIT_ASSERT( getDocumentType( pOffice, sTextDocPath ) == LOK_DOCTYPE_TEXT );
+
+ const string sPresentationDocPath = m_sSrcRoot + "/libreofficekit/qa/data/blank_presentation.odp";
+ const string sPresentationLockFile = m_sSrcRoot +"/libreofficekit/qa/data/.~lock.blank_presentation.odp#";
+
+ // FIXME: same comment as below wrt lockfile removal.
+ remove( sPresentationLockFile.c_str() );
+
+ CPPUNIT_ASSERT( getDocumentType( pOffice, sPresentationDocPath ) == LOK_DOCTYPE_PRESENTATION );
+
+ // TODO: do this for all supported document types
+}
+
void TiledRenderingTest::testImpressSlideNames( Office* pOffice )
{
const string sDocPath = m_sSrcRoot + "/libreofficekit/qa/data/impress_slidenames.odp";