diff options
Diffstat (limited to 'tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp')
-rw-r--r-- | tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp b/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp index 44dd4a74cf..81dcaa0975 100644 --- a/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp +++ b/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp @@ -34,9 +34,9 @@ #include <QThread> #include <QElapsedTimer> -const QString test(qTableName("test", __FILE__, QSqlDatabase())), - test2(qTableName("test2", __FILE__, QSqlDatabase())), - test3(qTableName("test3", __FILE__, QSqlDatabase())); +QString test; +QString test2; +QString test3; // In order to catch when the warning message occurs, indicating that the database belongs to another // thread, we have to install our own message handler. To ensure that the test reporting still happens @@ -164,6 +164,15 @@ private: tst_QSqlTableModel::tst_QSqlTableModel() { + static QSqlDatabase static_qtest_db_1 = QSqlDatabase(); + test = qTableName("test1", __FILE__, static_qtest_db_1); + + static QSqlDatabase static_qtest_db_2 = QSqlDatabase(); + test2 = qTableName("test2", __FILE__, static_qtest_db_2); + + static QSqlDatabase static_qtest_db_3 = QSqlDatabase(); + test3 = qTableName("test3", __FILE__, static_qtest_db_3); + QVERIFY(dbs.open()); } |