equal
deleted
inserted
replaced
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 |