diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-08-24 13:35:22 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-08-31 19:56:59 +0000 |
commit | 50b9e30970effae249010338880f74641f188f76 (patch) | |
tree | 472e644f7b4799a562cdcfea9ed327341925ecad /tests/manual | |
parent | 1ca789bfe3c5617efdec698e4f5377c0611589d2 (diff) |
qtbase tests: Remove QT_DISABLE_DEPRECATED_BEFORE=0 for simple cases.
Fix usage of API that is marked deprecated.
Change-Id: Ie31b6ee029c5b5f015fe52fb9bcd8e94b22d6cd0
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Diffstat (limited to 'tests/manual')
4 files changed, 12 insertions, 11 deletions
diff --git a/tests/manual/network_remote_stresstest/network_remote_stresstest.pro b/tests/manual/network_remote_stresstest/network_remote_stresstest.pro index 736747e486..754776f7e9 100644 --- a/tests/manual/network_remote_stresstest/network_remote_stresstest.pro +++ b/tests/manual/network_remote_stresstest/network_remote_stresstest.pro @@ -7,4 +7,3 @@ SOURCES += tst_network_remote_stresstest.cpp RESOURCES += url-list.qrc LIBS += $$QMAKE_LIBS_NETWORK -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp b/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp index 486c5179b7..df61325439 100644 --- a/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp +++ b/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp @@ -246,30 +246,31 @@ void tst_NetworkRemoteStressTest::blockingSequentialRemoteHosts() socket = QSharedPointer<QTcpSocket>(new QTcpSocket); socket->connectToHost(url.host(), url.port(isHttps ? 443 : 80)); - QVERIFY2(socket->waitForConnected(10000), "Timeout connecting to " + url.encodedHost()); + const QByteArray encodedHost = url.host(QUrl::FullyEncoded).toLatin1(); + QVERIFY2(socket->waitForConnected(10000), "Timeout connecting to " + encodedHost); #ifndef QT_NO_SSL if (isHttps) { static_cast<QSslSocket *>(socket.data())->setProtocol(QSsl::TlsV1_0); static_cast<QSslSocket *>(socket.data())->startClientEncryption(); static_cast<QSslSocket *>(socket.data())->ignoreSslErrors(); - QVERIFY2(static_cast<QSslSocket *>(socket.data())->waitForEncrypted(10000), "Timeout starting TLS with " + url.encodedHost()); + QVERIFY2(static_cast<QSslSocket *>(socket.data())->waitForEncrypted(10000), "Timeout starting TLS with " + encodedHost); } #endif // QT_NO_SSL socket->write("GET " + url.toEncoded(QUrl::RemoveScheme | QUrl::RemoveAuthority | QUrl::RemoveFragment) + " HTTP/1.0\r\n" "Connection: close\r\n" "User-Agent: tst_QTcpSocket_stresstest/1.0\r\n" - "Host: " + url.encodedHost() + "\r\n" + "Host: " + encodedHost + "\r\n" "\r\n"); while (socket->bytesToWrite()) - QVERIFY2(socket->waitForBytesWritten(10000), "Timeout writing to " + url.encodedHost()); + QVERIFY2(socket->waitForBytesWritten(10000), "Timeout writing to " + encodedHost); while (socket->state() == QAbstractSocket::ConnectedState && !timeout.hasExpired(10000)) { socket->waitForReadyRead(10000); byteCounter += socket->readAll().size(); // discard } - QVERIFY2(!timeout.hasExpired(10000), "Timeout reading from " + url.encodedHost()); + QVERIFY2(!timeout.hasExpired(10000), "Timeout reading from " + encodedHost); totalBytes += byteCounter; if (intermediateDebug) { @@ -318,16 +319,17 @@ void tst_NetworkRemoteStressTest::sequentialRemoteHosts() socket->connectToHost(url.host(), url.port(80)); } + const QByteArray encodedHost = url.host(QUrl::FullyEncoded).toLatin1(); socket->write("GET " + url.toEncoded(QUrl::RemoveScheme | QUrl::RemoveAuthority | QUrl::RemoveFragment) + " HTTP/1.0\r\n" "Connection: close\r\n" "User-Agent: tst_QTcpSocket_stresstest/1.0\r\n" - "Host: " + url.encodedHost() + "\r\n" + "Host: " + encodedHost + "\r\n" "\r\n"); connect(socket.data(), SIGNAL(readyRead()), SLOT(slotReadAll())); QTestEventLoop::instance().connect(socket.data(), SIGNAL(disconnected()), SLOT(exitLoop())); QTestEventLoop::instance().enterLoop(30); - QVERIFY2(!QTestEventLoop::instance().timeout(), "Timeout with " + url.encodedHost() + "; " + QVERIFY2(!QTestEventLoop::instance().timeout(), "Timeout with " + encodedHost + "; " + QByteArray::number(socket->bytesToWrite()) + " bytes to write"); totalBytes += byteCounter; @@ -397,10 +399,11 @@ void tst_NetworkRemoteStressTest::parallelRemoteHosts() socket->connectToHost(url.host(), url.port(isHttps ? 443 : 80)); } + const QByteArray encodedHost = url.host(QUrl::FullyEncoded).toLatin1(); socket->write("GET " + url.toEncoded(QUrl::RemoveScheme | QUrl::RemoveAuthority | QUrl::RemoveFragment) + " HTTP/1.0\r\n" "Connection: close\r\n" "User-Agent: tst_QTcpSocket_stresstest/1.0\r\n" - "Host: " + url.encodedHost() + "\r\n" + "Host: " + encodedHost + "\r\n" "\r\n"); connect(socket, SIGNAL(readyRead()), SLOT(slotReadAll())); QTestEventLoop::instance().connect(socket, SIGNAL(disconnected()), SLOT(exitLoop())); diff --git a/tests/manual/qtabletevent/device_information/device_information.pro b/tests/manual/qtabletevent/device_information/device_information.pro index 59669843ba..727ad34bc1 100644 --- a/tests/manual/qtabletevent/device_information/device_information.pro +++ b/tests/manual/qtabletevent/device_information/device_information.pro @@ -4,4 +4,3 @@ SOURCES += \ tabletwidget.cpp HEADERS += \ tabletwidget.h -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/manual/qtabletevent/device_information/tabletwidget.cpp b/tests/manual/qtabletevent/device_information/tabletwidget.cpp index 2e4cb6658f..e35cee65e8 100644 --- a/tests/manual/qtabletevent/device_information/tabletwidget.cpp +++ b/tests/manual/qtabletevent/device_information/tabletwidget.cpp @@ -61,7 +61,7 @@ bool TabletWidget::eventFilter(QObject *, QEvent *ev) mType = event->type(); mPos = event->pos(); mGPos = event->globalPos(); - mHiResGlobalPos = event->hiResGlobalPos(); + mHiResGlobalPos = event->posF(); mDev = event->device(); mPointerType = event->pointerType(); mUnique = event->uniqueId(); |