summaryrefslogtreecommitdiffstats
path: root/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp')
-rw-r--r--tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp b/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp
index e9bcdaad91..078e109530 100644
--- a/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp
+++ b/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp
@@ -1261,7 +1261,7 @@ void tst_QSqlTableModel::sqlite_attachedDatabase()
QSKIP(":memory: database, skipping test", SkipSingle);
QSqlDatabase attachedDb = QSqlDatabase::cloneDatabase(db, db.driverName() + QLatin1String("attached"));
- attachedDb.setDatabaseName(db.databaseName()+QLatin1String("attached.dat"));
+ attachedDb.setDatabaseName(dbs.sqLiteFileName());
QVERIFY_SQL(attachedDb, open());
QSqlQuery q(attachedDb);
tst_Databases::safeDropTables(attachedDb, QStringList() << "atest" << "atest2");
@@ -1297,6 +1297,7 @@ void tst_QSqlTableModel::sqlite_attachedDatabase()
QCOMPARE(model.rowCount(), 1);
QCOMPARE(model.data(model.index(0, 0), Qt::DisplayRole).toInt(), 3);
QCOMPARE(model.data(model.index(0, 1), Qt::DisplayRole).toString(), QLatin1String("main"));
+ attachedDb.close();
}