From f4be87e0583775fa5074aefa4bef4124b0c2d894 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 28 Jan 2019 17:12:27 +0100 Subject: dbaccess: fix Tdf119625Test with read-only $SRCDIR The buildLowLevelConnection() will try to modify the read-only storage and throw IOException. Change-Id: I9b8ec840bebcac3c8a69bc6921d32e692d9d9e86 Reviewed-on: https://gerrit.libreoffice.org/67027 Tested-by: Jenkins Reviewed-by: Michael Stahl --- dbaccess/qa/unit/hsql_binary_import.cxx | 5 +++-- dbaccess/qa/unit/tdf119625.cxx | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'dbaccess/qa') diff --git a/dbaccess/qa/unit/hsql_binary_import.cxx b/dbaccess/qa/unit/hsql_binary_import.cxx index 8bc81c0587b1..2c1c332629cb 100644 --- a/dbaccess/qa/unit/hsql_binary_import.cxx +++ b/dbaccess/qa/unit/hsql_binary_import.cxx @@ -45,8 +45,9 @@ void HsqlBinaryImportTest::setUp() void HsqlBinaryImportTest::testBinaryImport() { - uno::Reference xDocument - = getDocumentForFileName("hsqldb_migration_test.odb"); + // the migration requires the file to be writable + utl::TempFile const temp(createTempCopy("hsqldb_migration_test.odb")); + uno::Reference const xDocument = getDocumentForUrl(temp.GetURL()); uno::Reference xConnection = getConnectionForDocument(xDocument); // at this point migration is already done diff --git a/dbaccess/qa/unit/tdf119625.cxx b/dbaccess/qa/unit/tdf119625.cxx index f9aea7b8d004..d38e85bb75a3 100644 --- a/dbaccess/qa/unit/tdf119625.cxx +++ b/dbaccess/qa/unit/tdf119625.cxx @@ -63,7 +63,9 @@ static const expect_t expect[] void Tdf119625Test::testTime() { - uno::Reference xDocument = getDocumentForFileName("tdf119625.odb"); + // the migration requires the file to be writable + utl::TempFile const temp(createTempCopy("tdf119625.odb")); + uno::Reference const xDocument = getDocumentForUrl(temp.GetURL()); uno::Reference xConnection = getConnectionForDocument(xDocument); // at this point migration is already done -- cgit