From 6e18293299606d9d87e4567b712a83fe59c420fc Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 25 Aug 2017 16:39:25 +0200 Subject: Forward the readChannelFinished from the plain socket to the ssl socket Task-number: QTBUG-62257 Change-Id: I12632b7ffd2012adc99b4784892cbb6f79e065f7 Reviewed-by: Jesus Fernandez --- .../auto/network/ssl/qsslsocket/tst_qsslsocket.cpp | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tests') diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp index 8a8522760c..1545743ee9 100644 --- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp @@ -237,6 +237,7 @@ private slots: void ephemeralServerKey(); void allowedProtocolNegotiation(); void pskServer(); + void forwardReadChannelFinished(); #endif void setEmptyDefaultConfiguration(); // this test should be last @@ -3771,6 +3772,28 @@ void tst_QSslSocket::pskServer() QCOMPARE(disconnectedSpy.count(), 1); } +void tst_QSslSocket::forwardReadChannelFinished() +{ + if (!QSslSocket::supportsSsl()) + QSKIP("Needs SSL"); + QFETCH_GLOBAL(bool, setProxy); + if (setProxy) + QSKIP("This test doesn't work via a proxy"); + + QSslSocket socket; + QSignalSpy readChannelFinishedSpy(&socket, &QAbstractSocket::readChannelFinished); + connect(&socket, &QSslSocket::encrypted, [&socket]() { + const auto data = QString("GET /ip HTTP/1.0\r\nHost: %1\r\n\r\nAccept: */*\r\n\r\n") + .arg(QtNetworkSettings::serverLocalName()).toUtf8(); + socket.write(data); + }); + connect(&socket, &QSslSocket::readChannelFinished, + &QTestEventLoop::instance(), &QTestEventLoop::exitLoop); + socket.connectToHostEncrypted(QtNetworkSettings::serverLocalName(), 443); + enterLoop(10); + QVERIFY(readChannelFinishedSpy.count()); +} + #endif // QT_NO_OPENSSL #endif // QT_NO_SSL -- cgit v1.2.3 From 541a03155222af509ab703cf6665b19baf25344b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 17 Aug 2017 19:13:07 -0700 Subject: tst_QMutex: produce less noise with MSVC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since MSVC doesn't have (according to QT_HAS_INCLUDE), the QSKIP in the test was printed for every line in the table. Instead, add the skip in the _data() function. Change-Id: I6e9274c1e7444ad48c81fffd14dbcee5e5a322aa Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Olivier Goffart (Woboq GmbH) --- tests/auto/corelib/thread/qmutex/tst_qmutex.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') diff --git a/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp b/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp index 0962001741..7fb9a861d7 100644 --- a/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp +++ b/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp @@ -99,6 +99,9 @@ void tst_QMutex::convertToMilliseconds_data() QTest::addColumn("intValue"); QTest::addColumn("expected"); +#if !QT_HAS_INCLUDE() + QSKIP("This test requires "); +#endif auto add = [](TimeUnit unit, double d, long long i, qint64 expected) { const QScopedArrayPointer enumName(QTest::toString(unit)); -- cgit v1.2.3 From ced0f54ec3c79ff4d3e6d8048ce7330d1e19f971 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sat, 26 Aug 2017 22:54:33 +0300 Subject: Fix resolution of relative links on Windows [ChangeLog][QtCore][QFileInfo] Relative symbolic links on Windows are now resolved to their absolute path by symLinkTarget(). Task-number: QTBUG-62802 Change-Id: I5826517130bd389aef994bf3f4b6d99b2a91b409 Reviewed-by: Friedemann Kleint Reviewed-by: Joerg Bornemann --- tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index 17f41cba2b..f35dab2cad 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -1509,21 +1509,27 @@ void tst_QFileInfo::ntfsJunctionPointsAndSymlinks_data() QVERIFY2(file.exists(), msgDoesNotExist(file.fileName()).constData()); QTest::newRow("absolute dir symlink") << absSymlink << true << QDir::fromNativeSeparators(absTarget) << target.canonicalPath(); - QTest::newRow("relative dir symlink") << relSymlink << true << QDir::fromNativeSeparators(relTarget) << target.canonicalPath(); + QTest::newRow("relative dir symlink") << relSymlink << true << QDir::fromNativeSeparators(absTarget) << target.canonicalPath(); QTest::newRow("file in symlink dir") << fileInSymlink << false << "" << target.canonicalPath().append("/file"); } { //File symlinks + pwd.mkdir("relative"); + QDir relativeDir("relative"); QFileInfo target(m_sourceFile); QString absTarget = QDir::toNativeSeparators(target.absoluteFilePath()); QString absSymlink = QDir::toNativeSeparators(pwd.absolutePath()).append("\\abs_symlink.cpp"); QString relTarget = QDir::toNativeSeparators(pwd.relativeFilePath(target.absoluteFilePath())); QString relSymlink = "rel_symlink.cpp"; + QString relToRelTarget = QDir::toNativeSeparators(relativeDir.relativeFilePath(target.absoluteFilePath())); + QString relToRelSymlink = "relative/rel_symlink"; QVERIFY(pwd.exists("abs_symlink.cpp") || createSymbolicLinkW((wchar_t*)absSymlink.utf16(),(wchar_t*)absTarget.utf16(),0x0)); QVERIFY(pwd.exists(relSymlink) || createSymbolicLinkW((wchar_t*)relSymlink.utf16(),(wchar_t*)relTarget.utf16(),0x0)); - + QVERIFY(pwd.exists(relToRelSymlink) + || createSymbolicLinkW((wchar_t*)relToRelSymlink.utf16(), (wchar_t*)relToRelTarget.utf16(),0x0)); QTest::newRow("absolute file symlink") << absSymlink << true << QDir::fromNativeSeparators(absTarget) << target.canonicalFilePath(); - QTest::newRow("relative file symlink") << relSymlink << true << QDir::fromNativeSeparators(relTarget) << target.canonicalFilePath(); + QTest::newRow("relative file symlink") << relSymlink << true << QDir::fromNativeSeparators(absTarget) << target.canonicalFilePath(); + QTest::newRow("relative to relative file symlink") << relToRelSymlink << true << QDir::fromNativeSeparators(absTarget) << target.canonicalFilePath(); } //Junctions -- cgit v1.2.3 From 093064fdeb6e777d2dc88dbb4f4adb8fddac3aa5 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Sat, 2 Sep 2017 20:52:48 +0200 Subject: Convert features.completer to QT_[REQUIRE_]CONFIG Change-Id: If45a46c08b37d245229a39f3d6ffbb34154934f2 Reviewed-by: Oswald Buddenhagen --- tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp | 4 ++-- tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp index cc32e73b9c..88bae686ab 100644 --- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp +++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp @@ -83,7 +83,7 @@ private slots: void customPaperSizeAndMargins(); void customPaperNameSettingBySize(); void customPaperNameSettingByName(); -#if !defined(QT_NO_COMPLETER) && QT_CONFIG(filedialog) +#if QT_CONFIG(completer) && QT_CONFIG(filedialog) void printDialogCompleter(); #endif void testCurrentPage(); @@ -587,7 +587,7 @@ void tst_QPrinter::customPaperSizeAndMargins() } } -#if !defined(QT_NO_COMPLETER) && QT_CONFIG(filedialog) +#if QT_CONFIG(completer) && QT_CONFIG(filedialog) void tst_QPrinter::printDialogCompleter() { QPrintDialog dialog; diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp index 8a17a4a327..cf1e19d598 100644 --- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp @@ -261,7 +261,7 @@ private slots: // task-specific tests: void task180999_focus(); void task174640_editingFinished(); -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) void task198789_currentCompletion(); void task210502_caseInsensitiveInlineCompletion(); #endif @@ -3630,7 +3630,7 @@ void tst_QLineEdit::task174640_editingFinished() QCOMPARE(editingFinishedSpy.count(), 1); } -#ifndef QT_NO_COMPLETER +#if QT_CONFIG(completer) class task198789_Widget : public QWidget { Q_OBJECT @@ -3689,7 +3689,7 @@ void tst_QLineEdit::task210502_caseInsensitiveInlineCompletion() QCOMPARE(lineEdit.text(), completion); } -#endif // QT_NO_COMPLETER +#endif // QT_CONFIG(completer) void tst_QLineEdit::task229938_dontEmitChangedWhenTextIsNotChanged() -- cgit v1.2.3 From a2dbf1e779d36915b4c9c3574168e38cdef19ec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Saraj=C3=A4rvi?= Date: Mon, 4 Sep 2017 08:59:42 +0300 Subject: Blacklist tst_QItemDelegate::enterKey tests on openSUSE 42.3 Task-number: QTBUG-62967 Change-Id: I42f25120f1a9e2ef6a9a147e4f36edcdff2922a6 Reviewed-by: Heikki Halmet --- tests/auto/widgets/itemviews/qitemdelegate/BLACKLIST | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 tests/auto/widgets/itemviews/qitemdelegate/BLACKLIST (limited to 'tests') diff --git a/tests/auto/widgets/itemviews/qitemdelegate/BLACKLIST b/tests/auto/widgets/itemviews/qitemdelegate/BLACKLIST new file mode 100644 index 0000000000..0d658dcfb6 --- /dev/null +++ b/tests/auto/widgets/itemviews/qitemdelegate/BLACKLIST @@ -0,0 +1,4 @@ +[enterKey:plaintextedit tab] +opensuse-42.3 +[enterKey:plaintextedit backtab] +opensuse-42.3 -- cgit v1.2.3 From f9fea20c10ca7864cfa551fce23124d358c11b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Saraj=C3=A4rvi?= Date: Mon, 4 Sep 2017 09:05:47 +0300 Subject: Extend blacklisting of tst_QWidget::maskedUpdate to openSUSE 42.3 Task-number: QTBUG-51399 Change-Id: I7fcc52da2ce539251f6bad0394c4580dd76439a7 Reviewed-by: Heikki Halmet --- tests/auto/widgets/kernel/qwidget/BLACKLIST | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST index 0750526464..010e96467c 100644 --- a/tests/auto/widgets/kernel/qwidget/BLACKLIST +++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST @@ -60,6 +60,7 @@ osx [maskedUpdate] osx opensuse-42.1 +opensuse-42.3 [hideWhenFocusWidgetIsChild] osx-10.10 [hideOpaqueChildWhileHidden] -- cgit v1.2.3 From c6b9c6e5f2cf04728cd98f2305a2d4ef80e49f2a Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Mon, 4 Sep 2017 21:52:30 +0200 Subject: Convert features.socks5 to QT_[REQUIRE_]CONFIG The sources were already added conditionally in the project file since 179fe5981fa. Change-Id: I0baaec2e772f3e596d311c1973b9745aa2b80423 Reviewed-by: Oswald Buddenhagen --- tests/auto/network/access/qftp/tst_qftp.cpp | 4 ++-- tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp | 2 +- tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/auto/network/access/qftp/tst_qftp.cpp b/tests/auto/network/access/qftp/tst_qftp.cpp index 3711ce431c..fba0508f04 100644 --- a/tests/auto/network/access/qftp/tst_qftp.cpp +++ b/tests/auto/network/access/qftp/tst_qftp.cpp @@ -186,7 +186,7 @@ void tst_QFtp::initTestCase_data() QTest::addColumn("setSession"); QTest::newRow("WithoutProxy") << false << 0 << false; -#ifndef QT_NO_SOCKS5 +#if QT_CONFIG(socks5) QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy) << false; #endif //### doesn't work well yet. @@ -194,7 +194,7 @@ void tst_QFtp::initTestCase_data() #ifndef QT_NO_BEARERMANAGEMENT QTest::newRow("WithoutProxyWithSession") << false << 0 << true; -#ifndef QT_NO_SOCKS5 +#if QT_CONFIG(socks5) QTest::newRow("WithSocks5ProxyAndSession") << true << int(QNetworkProxy::Socks5Proxy) << true; #endif #endif diff --git a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp index c4432c83ee..31f82539aa 100644 --- a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp +++ b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp @@ -149,7 +149,7 @@ void tst_QTcpServer::initTestCase_data() QTest::addColumn("proxyType"); QTest::newRow("WithoutProxy") << false << 0; -#ifndef QT_NO_SOCKS5 +#if QT_CONFIG(socks5) QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy); #endif diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp index af7cf24838..aeb6e61cd2 100644 --- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -205,7 +205,7 @@ void tst_QUdpSocket::initTestCase_data() QTest::addColumn("proxyType"); QTest::newRow("WithoutProxy") << false << 0; -#ifndef QT_NO_SOCKS5 +#if QT_CONFIG(socks5) if (!newTestServer) QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy); #endif @@ -233,14 +233,14 @@ void tst_QUdpSocket::init() { QFETCH_GLOBAL(bool, setProxy); if (setProxy) { -#ifndef QT_NO_SOCKS5 +#if QT_CONFIG(socks5) QFETCH_GLOBAL(int, proxyType); if (proxyType == QNetworkProxy::Socks5Proxy) { QNetworkProxy::setApplicationProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080)); } #else QSKIP("No proxy support"); -#endif // !QT_NO_SOCKS5 +#endif // QT_CONFIG(socks5) } } -- cgit v1.2.3