diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-05-20 16:41:05 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-05-20 16:41:05 (GMT) |
commit | f9d26f0bebd5bcc32d15c4a627251c44cf78389e (patch) | |
tree | 64a13ad1e625f35811286d8d468fe9f504a29df8 /tests | |
parent | 64fb80c40cb0fd978923d1931670ba70466bc76e (diff) | |
parent | 56a8e78869325453010fb6c41a5e2b9e6f8f1c95 (diff) | |
download | Qt-f9d26f0bebd5bcc32d15c4a627251c44cf78389e.zip Qt-f9d26f0bebd5bcc32d15c4a627251c44cf78389e.tar.gz Qt-f9d26f0bebd5bcc32d15c4a627251c44cf78389e.tar.bz2 |
Merge commit 'origin/4.5'
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp b/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp index f501e78..5ab5064 100644 --- a/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp +++ b/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp @@ -795,14 +795,14 @@ void tst_QSocks5SocketEngine::downloadBigFile() if (QTestEventLoop::instance().timeout()) QFAIL("Network operation timed out"); - QCOMPARE(bytesAvailable, qint64(10000309)); + QCOMPARE(bytesAvailable, qint64(10000000)); QVERIFY(tmpSocket->state() == QAbstractSocket::ConnectedState); - qDebug("\t\t%.1fMB/%.1fs: %.1fMB/s", + /*qDebug("\t\t%.1fMB/%.1fs: %.1fMB/s", bytesAvailable / (1024.0 * 1024.0), stopWatch.elapsed() / 1024.0, - (bytesAvailable / (stopWatch.elapsed() / 1000.0)) / (1024 * 1024)); + (bytesAvailable / (stopWatch.elapsed() / 1000.0)) / (1024 * 1024));*/ delete tmpSocket; tmpSocket = 0; @@ -816,7 +816,10 @@ void tst_QSocks5SocketEngine::exitLoopSlot() void tst_QSocks5SocketEngine::downloadBigFileSlot() { - bytesAvailable += tmpSocket->readAll().size(); + QByteArray tmp=tmpSocket->readAll(); + int correction=tmp.indexOf((char)0,0); //skip header + if (correction==-1) correction=0; + bytesAvailable += (tmp.size()-correction); if (bytesAvailable >= 10000000) QTestEventLoop::instance().exitLoop(); } |