QHttpNetworkConnection test: avoid integer divide by zero exception.

The speed calculation caused a dived by zero exception.

Change-Id: I83281c8e66b9c18e7d282920901ccac1e9444a68
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
bb10
Martin Petersson 2012-03-27 12:43:37 +02:00 committed by Qt by Nokia
parent a4d0c56a59
commit 854256cc69
1 changed files with 1 additions and 1 deletions

View File

@ -72,7 +72,7 @@ void tst_qhttpnetworkconnection::bigRemoteFile()
qDebug() << "Finished!" << endl;
qDebug() << "Time:" << t.elapsed() << "msec";
qDebug() << "Bytes:" << size;
qDebug() << "Speed:" << (size / 1024) / (t.elapsed() / 1000) << "KB/sec";
qDebug() << "Speed:" << (size / qreal(1024)) / (t.elapsed() / qreal(1000)) << "KB/sec";
}
QTEST_MAIN(tst_qhttpnetworkconnection)