summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej.hunt@collabora.com>2014-07-17 20:20:24 +0200
committerAndrzej Hunt <andrzej.hunt@collabora.com>2014-07-17 20:20:24 +0200
commit4118724dd506269b836d08fbe42207b76632eac8 (patch)
treee643943b0c9ca01be6723bd33dfc5f838544aeae
parentf2720469cc16727ccc616d56466d79af21690b7b (diff)
libreofficekit_tiledrendering test: force lock file removal
If the lock file still exists when running this test, LOK will fail resulting in "documentLoad failed: unknown load failure" (the actual error is that the lock file dialog cannot be confirmed by the user in headless mode, resulting in loading failure, however this is then hidden by multiple layers of exception redirection in sfx2). Change-Id: I025ea6187c3d17805f25ab6f756eae9646f2c7c8
-rw-r--r--libreofficekit/qa/unit/tiledrendering.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/libreofficekit/qa/unit/tiledrendering.cxx b/libreofficekit/qa/unit/tiledrendering.cxx
index dbe5b52850d6..cec35ed6db89 100644
--- a/libreofficekit/qa/unit/tiledrendering.cxx
+++ b/libreofficekit/qa/unit/tiledrendering.cxx
@@ -14,6 +14,7 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cstdlib>
#include <string>
+#include <stdio.h>
#include <sal/types.h>
#include <tools/stream.hxx>
@@ -66,6 +67,13 @@ void TiledRenderingTest::testOverlay()
const string sInstDir = getenv( "INSTDIR" );
const string sLOPath = sInstDir + "/program";
const string sDocPath = sSrcRoot + "/odk/examples/java/DocumentHandling/test/test1.odt";
+ const string sLockFile = sSrcRoot + "/odk/examples/java/DocumentHandling/test/.~lock.test1.odt#";
+
+ // 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< Office > pOffice( lok_cpp_init(
sLOPath.c_str() ) );