From 4c759340081384e7b9fae5d2179d25016dc1dda6 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 7 Jan 2019 12:14:19 +0100 Subject: [PATCH] Fix a couple of SQL tests One of the tests was not added to the parent subdirectory pro so this is also rectified. Change-Id: I270f1c2882260e3e3fac83d074ed6444c5dece19 Reviewed-by: Edward Welbourne --- tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp | 2 +- tests/auto/sql/models/models.pro | 8 ++++---- .../qsqlrelationaldelegate/tst_qsqlrelationaldelegate.cpp | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp index 8cf43e243b..af6b6ca881 100644 --- a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp +++ b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp @@ -909,7 +909,7 @@ void tst_QSqlDatabase::recordMySQL() FieldDef("date", QVariant::Date, QDate::currentDate()), FieldDef("datetime", QVariant::DateTime, dt), FieldDef("timestamp", QVariant::DateTime, dt, false), - FieldDef("time", QVariant::Time, dt.time()), + FieldDef("time", QVariant::String, dt.time()), FieldDef("year", QVariant::Int, 2003), FieldDef("char(20)", QVariant::String, "Blah"), FieldDef("varchar(20)", QVariant::String, "BlahBlah"), diff --git a/tests/auto/sql/models/models.pro b/tests/auto/sql/models/models.pro index 2c3ae4ef0a..da807f4351 100644 --- a/tests/auto/sql/models/models.pro +++ b/tests/auto/sql/models/models.pro @@ -1,8 +1,8 @@ TEMPLATE=subdirs -SUBDIRS=\ +qtHaveModule(widgets): SUBDIRS = \ qsqlquerymodel \ - qsqlrelationaltablemodel \ + qsqlrelationaldelegate + +SUBDIRS += qsqlrelationaltablemodel \ qsqltablemodel \ -!qtHaveModule(widgets): SUBDIRS -= \ - qsqlquerymodel diff --git a/tests/auto/sql/models/qsqlrelationaldelegate/tst_qsqlrelationaldelegate.cpp b/tests/auto/sql/models/qsqlrelationaldelegate/tst_qsqlrelationaldelegate.cpp index 36f592395e..a7089c06a1 100644 --- a/tests/auto/sql/models/qsqlrelationaldelegate/tst_qsqlrelationaldelegate.cpp +++ b/tests/auto/sql/models/qsqlrelationaldelegate/tst_qsqlrelationaldelegate.cpp @@ -158,12 +158,13 @@ void tst_QSqlRelationalDelegate::comboBoxEditor() QTest::keyClick(editor, Qt::Key_Down); QTest::keyClick(editor, Qt::Key_Enter); QCOMPARE(editor->currentText(), "mister"); + QTest::keyClick(tv.viewport(), Qt::Key_Tab); QVERIFY_SQL(model, submitAll()); QSqlQuery qry(db); QVERIFY_SQL(qry, exec("SELECT title_key FROM " + reltest1 + " WHERE id=1")); QVERIFY(qry.next()); - QCOMPARE(qry.value(0).toString(), "mister"); + QCOMPARE(qry.value(0).toString(), "2"); } QTEST_MAIN(tst_QSqlRelationalDelegate)