diff options
author | Liang Qi <liang.qi@qt.io> | 2018-11-10 11:36:18 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-11-10 11:38:40 +0100 |
commit | 58437fb125f60c11ba8e97c914fa8db8c89c7373 (patch) | |
tree | f47ed59073984ec76034155bc04d3d987b192d2e /tests/auto | |
parent | 76bb804405f424708fffec502788995ea91206b8 (diff) | |
parent | b20c15f2041205a1cab98fbaf9560a3e2e0d6367 (diff) |
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
src/corelib/serialization/qcborcommon.h
src/corelib/tools/qlocale_data_p.h
tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
Done-with: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: Ibed987f6d77a0294f78f67d78625237616082416
Diffstat (limited to 'tests/auto')
5 files changed, 36 insertions, 15 deletions
diff --git a/tests/auto/corelib/serialization/qcborstreamreader/tst_qcborstreamreader.cpp b/tests/auto/corelib/serialization/qcborstreamreader/tst_qcborstreamreader.cpp index 24d9c7409e..3dd4b5114c 100644 --- a/tests/auto/corelib/serialization/qcborstreamreader/tst_qcborstreamreader.cpp +++ b/tests/auto/corelib/serialization/qcborstreamreader/tst_qcborstreamreader.cpp @@ -269,7 +269,7 @@ void tst_QCborStreamReader::integers() quint64 absolute = (isNegative ? expectedRaw + 1 : expectedRaw); QBuffer buffer(&data); - QCborStreamReader reader(data); + QCborStreamReader reader(useDevice ? QByteArray() : data); if (useDevice) { buffer.open(QIODevice::ReadOnly); reader.setDevice(&buffer); @@ -605,7 +605,7 @@ void tst_QCborStreamReader::fixed() removeIndicators(expected); QBuffer buffer(&data); - QCborStreamReader reader(data); + QCborStreamReader reader(useDevice ? QByteArray() : data); if (useDevice) { buffer.open(QIODevice::ReadOnly); reader.setDevice(&buffer); diff --git a/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp b/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp index 0a2e024701..9d6ce78b24 100644 --- a/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp +++ b/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp @@ -74,6 +74,7 @@ private slots: void emptyBlocks(); void setCharFormat(); void highlightOnInit(); + void highlightOnInitAndAppend(); void stopHighlightingWhenStateDoesNotChange(); void unindent(); void highlightToEndOfDocument(); @@ -265,6 +266,19 @@ void tst_QSyntaxHighlighter::highlightOnInit() QTRY_VERIFY(hl->highlighted); } +void tst_QSyntaxHighlighter::highlightOnInitAndAppend() +{ + cursor.insertText("Hello"); + cursor.insertBlock(); + cursor.insertText("World"); + + TestHighlighter *hl = new TestHighlighter(doc); + cursor.insertBlock(); + cursor.insertText("More text"); + QTRY_VERIFY(hl->highlighted); + QVERIFY(hl->highlightedText.endsWith(doc->toPlainText().remove(QLatin1Char('\n')))); +} + class StateTestHighlighter : public QSyntaxHighlighter { public: @@ -330,6 +344,7 @@ void tst_QSyntaxHighlighter::unindent() QCOMPARE(doc->toPlainText(), plainText); TestHighlighter *hl = new TestHighlighter(doc); + QTRY_VERIFY(hl->highlighted); hl->callCount = 0; cursor.movePosition(QTextCursor::Start); diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp index 72b5d06dd5..395b30846d 100644 --- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp @@ -1343,13 +1343,19 @@ void tst_QSslSocket::protocolServerSide() QAbstractSocket::SocketState expectedState = (works) ? QAbstractSocket::ConnectedState : QAbstractSocket::UnconnectedState; // Determine whether the client or the server caused the event loop // to quit due to a socket error, and investigate the culprit. - if (server.socket->error() != QAbstractSocket::UnknownSocketError) { + if (client.error() != QAbstractSocket::UnknownSocketError) { + // It can happen that the client, after TCP connection established, before + // incomingConnection() slot fired, hits TLS initialization error and stops + // the loop, so the server socket is not created yet. + if (server.socket) + QVERIFY(server.socket->error() == QAbstractSocket::UnknownSocketError); + + QCOMPARE(client.state(), expectedState); + } else if (server.socket->error() != QAbstractSocket::UnknownSocketError) { QVERIFY(client.error() == QAbstractSocket::UnknownSocketError); QCOMPARE(server.socket->state(), expectedState); - } else if (client.error() != QAbstractSocket::UnknownSocketError) { - QVERIFY(server.socket->error() == QAbstractSocket::UnknownSocketError); - QCOMPARE(client.state(), expectedState); } + QCOMPARE(client.isEncrypted(), works); } diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp index 27eac03880..bd08461544 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp @@ -11348,7 +11348,7 @@ void tst_QGraphicsItem::QTBUG_7714_fullUpdateDiscardingOpacityUpdate2() origView.show(); QVERIFY(QTest::qWaitForWindowActive(&origView)); - origView.setGeometry(origView.width() + 20, 20, + origView.setGeometry(origView.x() + origView.width() + 20, origView.y() + 20, origView.width(), origView.height()); parentGreen->setFlag(QGraphicsItem::ItemIgnoresTransformations); diff --git a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp index e2f1307eb1..20aad6ba97 100644 --- a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp +++ b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp @@ -3848,7 +3848,7 @@ void tst_QDateTimeEdit::dateEditCorrectSectionSize_data() << threeDigitDayIssueKeypresses_DayName << QString::fromLatin1("00/2/Tuesday"); QTest::newRow("no fixday, leap, yy/M/ddd") << defaultLocale << defaultDate << QString::fromLatin1("yy/M/ddd") - << threeDigitDayIssueKeypresses_DayName << QString::fromLatin1("00/2/Tue."); + << threeDigitDayIssueKeypresses_DayName << QString::fromLatin1("00/2/Tue"); QTest::newRow("no fixday, leap, yy/MM/dddd") << defaultLocale << defaultDate << QString::fromLatin1("yy/MM/dddd") << threeDigitDayIssueKeypresses_DayName << QString::fromLatin1("00/02/Tuesday"); @@ -3896,13 +3896,13 @@ void tst_QDateTimeEdit::dateEditCorrectSectionSize_data() << threeDigitDayIssueKeypresses_YearDayMonth << QString::fromLatin1("2000/29/2"); QTest::newRow("fixday, leap, yyyy/MMM/dd") << defaultLocale << defaultDate << QString::fromLatin1("yyyy/MMM/dd") - << threeDigitDayIssueKeypresses_ShortMonthName << QString::fromLatin1("2000/Feb./29"); + << threeDigitDayIssueKeypresses_ShortMonthName << QString::fromLatin1("2000/Feb/29"); QTest::newRow("fixday, leap, yyyy/MMM/d") << defaultLocale << defaultDate << QString::fromLatin1("yyyy/MMM/d") - << threeDigitDayIssueKeypresses_ShortMonthName << QString::fromLatin1("2000/Feb./29"); + << threeDigitDayIssueKeypresses_ShortMonthName << QString::fromLatin1("2000/Feb/29"); QTest::newRow("fixday, leap, yy/MMM/dd") << defaultLocale << defaultDate << QString::fromLatin1("yy/MMM/dd") - << threeDigitDayIssueKeypresses_ShortMonthName << QString::fromLatin1("00/Feb./29"); + << threeDigitDayIssueKeypresses_ShortMonthName << QString::fromLatin1("00/Feb/29"); QTest::newRow("fixday, leap, yyyy/dddd/M") << defaultLocale << defaultDate << QString::fromLatin1("yyyy/dddd/M") << threeDigitDayIssueKeypresses_DayName_YearDayMonth << QString::fromLatin1("2000/Tuesday/2"); @@ -3977,16 +3977,16 @@ void tst_QDateTimeEdit::dateEditCorrectSectionSize_data() << threeDigitDayIssueKeypresses_MonthYearDay << QString::fromLatin1("02/2000/29"); QTest::newRow("fixday, leap, MMM/yy/d") << defaultLocale << defaultDate << QString::fromLatin1("MMM/yy/d") - << threeDigitDayIssueKeypresses_ShortMonthName_MonthYearDay << QString::fromLatin1("Feb./00/29"); + << threeDigitDayIssueKeypresses_ShortMonthName_MonthYearDay << QString::fromLatin1("Feb/00/29"); QTest::newRow("fixday, leap, MMM/yyyy/d") << defaultLocale << defaultDate << QString::fromLatin1("MMM/yyyy/d") - << threeDigitDayIssueKeypresses_ShortMonthName_MonthYearDay << QString::fromLatin1("Feb./2000/29"); + << threeDigitDayIssueKeypresses_ShortMonthName_MonthYearDay << QString::fromLatin1("Feb/2000/29"); QTest::newRow("fixday, MMM/yyyy/d") << defaultLocale << defaultDate.addYears(1) << QString::fromLatin1("MMM/yyyy/d") - << threeDigitDayIssueKeypresses_ShortMonthName_MonthYearDay << QString::fromLatin1("Feb./2001/28"); + << threeDigitDayIssueKeypresses_ShortMonthName_MonthYearDay << QString::fromLatin1("Feb/2001/28"); QTest::newRow("fixday, leap, MMM/yyyy/dd") << defaultLocale << defaultDate << QString::fromLatin1("MMM/yyyy/dd") - << threeDigitDayIssueKeypresses_ShortMonthName_MonthYearDay << QString::fromLatin1("Feb./2000/29"); + << threeDigitDayIssueKeypresses_ShortMonthName_MonthYearDay << QString::fromLatin1("Feb/2000/29"); QTest::newRow("fixday, leap, dddd, dd. MMMM yyyy") << defaultLocale << defaultDate << QString::fromLatin1("dddd, dd. MMMM yyyy") |