tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp
branchRCL_3
changeset 13 c0432d11811c
parent 4 3b1da2848fc7
equal deleted inserted replaced
12:cc75c76972ee 13:c0432d11811c
   645     connect(&socket, SIGNAL(readyRead()), SLOT(tcpSocketNonBlocking_readyRead()));
   645     connect(&socket, SIGNAL(readyRead()), SLOT(tcpSocketNonBlocking_readyRead()));
   646     tcpSocketNonBlocking_socket = &socket;
   646     tcpSocketNonBlocking_socket = &socket;
   647 
   647 
   648     // Connect
   648     // Connect
   649     socket.connectToHost(QtNetworkSettings::serverName(), 143);
   649     socket.connectToHost(QtNetworkSettings::serverName(), 143);
   650     QCOMPARE(socket.state(), QTcpSocket::HostLookupState);
   650     QVERIFY(socket.state() == QTcpSocket::HostLookupState ||
       
   651             socket.state() == QTcpSocket::ConnectingState);
   651 
   652 
   652     QTestEventLoop::instance().enterLoop(30);
   653     QTestEventLoop::instance().enterLoop(30);
   653     if (QTestEventLoop::instance().timeout()) {
   654     if (QTestEventLoop::instance().timeout()) {
   654         QFAIL("Timed out");
   655         QFAIL("Timed out");
   655     }
   656     }
   777     if (QTestEventLoop::instance().timeout())
   778     if (QTestEventLoop::instance().timeout())
   778         QFAIL("Network operation timed out");
   779         QFAIL("Network operation timed out");
   779 
   780 
   780     QByteArray hostName = QtNetworkSettings::serverName().toLatin1();
   781     QByteArray hostName = QtNetworkSettings::serverName().toLatin1();
   781     QVERIFY(tmpSocket->state() == QAbstractSocket::ConnectedState);
   782     QVERIFY(tmpSocket->state() == QAbstractSocket::ConnectedState);
   782     QVERIFY(tmpSocket->write("GET /mediumfile HTTP/1.0\r\n") > 0);
   783     QVERIFY(tmpSocket->write("GET /qtest/mediumfile HTTP/1.0\r\n") > 0);
   783     QVERIFY(tmpSocket->write("HOST: ") > 0);
   784     QVERIFY(tmpSocket->write("HOST: ") > 0);
   784     QVERIFY(tmpSocket->write(hostName.data()) > 0);
   785     QVERIFY(tmpSocket->write(hostName.data()) > 0);
   785     QVERIFY(tmpSocket->write("\r\n") > 0);
   786     QVERIFY(tmpSocket->write("\r\n") > 0);
   786     QVERIFY(tmpSocket->write("\r\n") > 0);
   787     QVERIFY(tmpSocket->write("\r\n") > 0);
   787 
   788