From 8ab7cbe751a1b643a2a72f06da2c8d7b9a3a3b31 Mon Sep 17 00:00:00 2001 From: Andrzej Hunt Date: Thu, 17 Jul 2014 20:20:24 +0200 Subject: 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 --- libreofficekit/qa/unit/tiledrendering.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) 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 #include #include +#include #include #include @@ -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() ) ); -- cgit