diff options
Diffstat (limited to 'tests/auto')
6 files changed, 23 insertions, 7 deletions
diff --git a/tests/auto/network/access/http2/http2srv.cpp b/tests/auto/network/access/http2/http2srv.cpp index 1f9ffb8985..6e2220fa67 100644 --- a/tests/auto/network/access/http2/http2srv.cpp +++ b/tests/auto/network/access/http2/http2srv.cpp @@ -431,6 +431,13 @@ void Http2Server::readReady() if (connectionError) return; + if (redirectSent) { + // We are a "single shot" server, working in 'h2' mode, + // responding with a redirect code. Don't bother to handle + // anything else now. + return; + } + if (upgradeProtocol) { handleProtocolUpgrade(); } else if (waitingClientPreface) { @@ -800,6 +807,13 @@ void Http2Server::sendResponse(quint32 streamID, bool emptyBody) HttpHeader header; if (redirectWhileReading) { + if (redirectSent) { + // This is a "single-shot" server responding with a redirect code. + return; + } + + redirectSent = true; + qDebug("server received HEADERS frame (followed by DATA frames), redirecting ..."); Q_ASSERT(targetPort); header.push_back({":status", "308"}); diff --git a/tests/auto/network/access/http2/http2srv.h b/tests/auto/network/access/http2/http2srv.h index 87a17ced8b..ae3f084fdc 100644 --- a/tests/auto/network/access/http2/http2srv.h +++ b/tests/auto/network/access/http2/http2srv.h @@ -193,6 +193,7 @@ private: // Redirect, with status code 308, as soon as we've seen headers, while client // may still be sending DATA frames. See tst_Http2::earlyResponse(). bool redirectWhileReading = false; + bool redirectSent = false; quint16 targetPort = 0; QAtomicInt interrupted; protected slots: diff --git a/tests/auto/network/access/http2/tst_http2.cpp b/tests/auto/network/access/http2/tst_http2.cpp index bbb314128b..02c5e51cbe 100644 --- a/tests/auto/network/access/http2/tst_http2.cpp +++ b/tests/auto/network/access/http2/tst_http2.cpp @@ -474,7 +474,7 @@ void tst_Http2::earlyResponse() runEventLoop(); QVERIFY(serverPort); - sendRequest(1, QNetworkRequest::NormalPriority, {10000000, Qt::Uninitialized}); + sendRequest(1, QNetworkRequest::NormalPriority, {1000000, Qt::Uninitialized}); runEventLoop(); diff --git a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp index 892c743dbf..f309231b10 100644 --- a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp +++ b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp @@ -913,7 +913,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) |