Fix some warnings in symbian network tests

Ignore warning when the test intentionally sets an invalid socket descriptor.
Make sure to set content type on all http post tests in tst_qnetworkreply.
Run test with enough capabilities to avoid platsec errors when accessing
certificate store.

Reviewed-By: Markus Goetz
(cherry picked from commit 9632fdefa9012ca11cd1345d66bafd6f417de88e)
This commit is contained in:
Shane Kearns 2011-04-12 17:58:12 +01:00 committed by Olivier Goffart
parent 1a1af689fc
commit 605102d5c6
4 changed files with 9 additions and 1 deletions

View File

@ -4103,6 +4103,7 @@ void tst_QNetworkReply::ioPostToHttpFromMiddleOfQBufferFiveBytes()
QUrl url = "http://" + QtNetworkSettings::serverName() + "/qtest/protected/cgi-bin/md5sum.cgi";
QNetworkRequest request(url);
request.setRawHeader("Content-Type", "application/octet-stream");
QNetworkReplyPtr reply = manager.post(request, &uploadBuffer);
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
@ -4359,6 +4360,7 @@ void tst_QNetworkReply::ioPostToHttpUploadProgress()
// create the request
QUrl url = QUrl(QString("http://127.0.0.1:%1/").arg(server.serverPort()));
QNetworkRequest request(url);
request.setRawHeader("Content-Type", "application/octet-stream");
QNetworkReplyPtr reply = manager.post(request, &sourceFile);
QSignalSpy spy(reply, SIGNAL(uploadProgress(qint64,qint64)));
connect(&server, SIGNAL(newConnection()), &QTestEventLoop::instance(), SLOT(exitLoop()));

View File

@ -430,6 +430,9 @@ void tst_QTcpServer::waitForConnectionTest()
void tst_QTcpServer::setSocketDescriptor()
{
QTcpServer server;
#ifdef Q_OS_SYMBIAN
QTest::ignoreMessage(QtWarningMsg, "QSymbianSocketEngine::initialize - socket descriptor not found");
#endif
QVERIFY(!server.setSocketDescriptor(42));
QCOMPARE(server.serverError(), QAbstractSocket::UnsupportedSocketOperationError);
#ifndef Q_OS_SYMBIAN

View File

@ -13,7 +13,7 @@ vxworks:QT -= gui
symbian: {
TARGET.EPOCHEAPSIZE="0x100 0x3000000"
TARGET.CAPABILITY = NetworkServices
TARGET.CAPABILITY = NetworkServices ReadUserData
}
TARGET = tst_qtcpsocket

View File

@ -476,6 +476,9 @@ void tst_QTcpSocket::setInvalidSocketDescriptor()
{
QTcpSocket *socket = newSocket();
QCOMPARE(socket->socketDescriptor(), -1);
#ifdef Q_OS_SYMBIAN
QTest::ignoreMessage(QtWarningMsg, "QSymbianSocketEngine::initialize - socket descriptor not found");
#endif
QVERIFY(!socket->setSocketDescriptor(-5, QTcpSocket::UnconnectedState));
QCOMPARE(socket->socketDescriptor(), -1);