diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2018-03-15 15:45:31 +0300 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-07-03 11:33:26 +0300 |
commit | d114212333e1350eb244164f387e955c59a52967 (patch) | |
tree | 0d12d34bd2738dc5d7257ac797eef6b34a7c6867 /test | |
parent | 779969f8653dc4dc2ee6fdd814d7595bfd1498cc (diff) |
OwnSql: Fixup after feedback for #6388
Diffstat (limited to 'test')
-rw-r--r-- | test/testownsql.cpp | 15 |
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; }; |