diff options
author | Andrzej Hunt <andrzej.hunt@collabora.com> | 2014-07-31 11:57:09 +0200 |
---|---|---|
committer | Andrzej Hunt <andrzej.hunt@collabora.com> | 2014-07-31 12:31:46 +0200 |
commit | 5909d640dc2fe7b6aed0aa6e9136d981b09175ad (patch) | |
tree | db1b50a0d8d10da455e5ab97cf39078c911675f8 /libreofficekit | |
parent | dd418d8ca230da09a15de10db66970bb50db0172 (diff) |
LOK: add document loading failure test.
We don't really have any way of telling the client that the file didn't
exist yet though, so not very useful so far.
Change-Id: I1db386781b88b345f3e9cb4f37838ca1d95f92f9
Diffstat (limited to 'libreofficekit')
-rw-r--r-- | libreofficekit/qa/unit/tiledrendering.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libreofficekit/qa/unit/tiledrendering.cxx b/libreofficekit/qa/unit/tiledrendering.cxx index 043ffafcd63c..5d6100003875 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 testDocumentLoadFail( Office* pOffice ); void testDocumentTypes( Office* pOffice ); void testImpressSlideNames( Office* pOffice ); void testOverlay( Office* pOffice ); @@ -63,11 +64,23 @@ void TiledRenderingTest::runAllTests() m_sLOPath.c_str() ) ); CPPUNIT_ASSERT( pOffice.get() ); + testDocumentLoadFail( pOffice.get() ); testDocumentTypes( pOffice.get() ); testImpressSlideNames( pOffice.get() ); testOverlay( pOffice.get() ); } +void TiledRenderingTest::testDocumentLoadFail( Office* pOffice ) +{ + const string sDocPath = m_sSrcRoot + "/libreofficekit/qa/data/IDONOTEXIST.odt"; + scoped_ptr< Document> pDocument( pOffice->documentLoad( sDocPath.c_str() ) ); + CPPUNIT_ASSERT( !pDocument.get() ); + // TODO: we probably want to have some way of returning what + // the cause of failure was. getError() will return + // something along the lines of: + // "Unsupported URL <file:///SRC_ROOT/libreofficekit/qa/data/IDONOTEXIST.odt>: "type detection failed"" +} + // Our dumped .png files end up in // workdir/CppunitTest/libreofficekit_tiledrendering.test.core |