Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2018-03-15 15:45:31 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2018-07-03 11:33:26 +0300
commitd114212333e1350eb244164f387e955c59a52967 (patch)
tree0d12d34bd2738dc5d7257ac797eef6b34a7c6867 /test
parent779969f8653dc4dc2ee6fdd814d7595bfd1498cc (diff)
OwnSql: Fixup after feedback for #6388
Diffstat (limited to 'test')
-rw-r--r--test/testownsql.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/testownsql.cpp b/test/testownsql.cpp
index 77541794a..86ec77d28 100644
--- a/test/testownsql.cpp
+++ b/test/testownsql.cpp
@@ -126,6 +126,21 @@ private slots:
}
}
+ void testDestructor()
+ {
+ // This test make sure that the destructor of SqlQuery works even if the SqlDatabase
+ // is destroyed before
+ QScopedPointer<SqlDatabase> db(new SqlDatabase());
+ SqlQuery q1(_db);
+ SqlQuery q2(_db);
+ q2.prepare("SELECT * FROM addresses");
+ SqlQuery q3("SELECT * FROM addresses", _db);
+ SqlQuery q4;
+ SqlQuery q5;
+ q5.initOrReset("SELECT * FROM addresses", _db);
+ db.reset();
+ }
+
private:
SqlDatabase _db;
};