[Pkg-owncloud-commits] [owncloud-client] 03/135: Use QTemporaryDir in TestOwnSql
Sandro Knauß
hefee at debian.org
Sat Sep 9 14:28:21 UTC 2017
This is an automated email from the git hooks/post-receive script.
hefee pushed a commit to branch master
in repository owncloud-client.
commit 879dadba780b3a5ae4ba2400c6d47367e35523af
Author: Jocelyn Turcotte <jturcotte at woboq.com>
Date: Mon May 8 19:17:30 2017 +0200
Use QTemporaryDir in TestOwnSql
This will improve the cleanup and possibly help for #5366.
---
test/CMakeLists.txt | 2 +-
test/testownsql.cpp | 25 +++----------------------
2 files changed, 4 insertions(+), 23 deletions(-)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 2f94501..b75ec07 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -25,7 +25,6 @@ list(APPEND FolderWatcher_SRC ../src/gui/socketapisocket_mac.mm)
ENDIF()
owncloud_add_test(CSyncSqlite "")
owncloud_add_test(NetrcParser ../src/cmd/netrcparser.cpp)
-owncloud_add_test(OwnSql "")
owncloud_add_test(SyncJournalDB "")
owncloud_add_test(SyncFileItem "")
owncloud_add_test(ConcatUrl "")
@@ -35,6 +34,7 @@ owncloud_add_test(ChecksumValidator "")
owncloud_add_test(ExcludedFiles "")
if(HAVE_QT5 AND NOT BUILD_WITH_QT4)
owncloud_add_test(FileSystem "")
+ owncloud_add_test(OwnSql "")
owncloud_add_test(Utility "")
owncloud_add_test(SyncEngine "syncenginetestutils.h")
owncloud_add_test(SyncFileStatusTracker "syncenginetestutils.h")
diff --git a/test/testownsql.cpp b/test/testownsql.cpp
index a926545..0172468 100644
--- a/test/testownsql.cpp
+++ b/test/testownsql.cpp
@@ -12,37 +12,18 @@
using namespace OCC;
-namespace {
-
-const char testdbC[] = "/tmp/testdb.sqlite";
-}
-
class TestOwnSql : public QObject
{
Q_OBJECT
+ QTemporaryDir _tempDir;
private slots:
- void initTestCase() {
- QFileInfo fi( testdbC );
-
- if( fi.exists() ) {
- QFile::remove(testdbC);
- }
- fi.refresh();
- QVERIFY(!fi.exists());
- }
-
- void cleanupTestCase() {
- // QFile::remove(testdbC);
- }
-
void testOpenDb() {
- QFileInfo fi( testdbC );
+ QFileInfo fi( _tempDir.path() + "/testdb.sqlite" );
QVERIFY( !fi.exists() ); // must not exist
- _db.openOrCreateReadWrite(testdbC);
+ _db.openOrCreateReadWrite(fi.filePath());
fi.refresh();
QVERIFY(fi.exists());
-
}
void testCreate() {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list