diff options
author | Andrzej Hunt <andrzej.hunt@collabora.com> | 2014-07-17 20:20:24 +0200 |
---|---|---|
committer | Andrzej Hunt <andrzej.hunt@collabora.com> | 2014-07-17 20:39:10 +0200 |
commit | 8ab7cbe751a1b643a2a72f06da2c8d7b9a3a3b31 (patch) | |
tree | 6ebbe716a9a313eb9ddf73eebf1077cb9ff8ab0f | |
parent | 74eb70f957c28aa3fd3de0f215f31310608ab562 (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.cxx | 8 |
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() ) ); |