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

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2018-03-15 15:45:31 +0300
committerOlivier Goffart <olivier@woboq.com>2018-03-15 21:30:21 +0300
commit0bf0f929490bd717e3e2abaa53bb8a257acc86ae (patch)
tree06b911f96a646ed3013ab512626298e23d7cf2f0 /test/testownsql.cpp
parent04f8d0f2bc90463fb8ddf348b96ff7bb3a8ae910 (diff)
OwnSql: Fixup after feedback for #6388
Diffstat (limited to 'test/testownsql.cpp')
-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;
};