Fix MSVC-warnings about unsafe bool operations in tst_qcamera.cpp.

qglobal.h(501) : warning C4804: '-' : unsafe use of type 'bool' in operation
global/qglobal.h(501) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
tst_qcamera.cpp(507) : see reference to function template instantiation 'T qAbs<bool>(const T &)' being compiled

Change-Id: Ifd467b5536a0d386f592ae339129b3ebfb7b8838
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
This commit is contained in:
Friedemann Kleint
2014-01-24 14:49:08 +01:00
committed by The Qt Project
parent 8bfd49d40f
commit 04b7e05375

View File

@@ -504,7 +504,8 @@ void tst_QCamera::testCameraCaptureMetadata()
QCOMPARE(metadata[0].toInt(), id);
QCOMPARE(metadata[1].toString(), QMediaMetaData::DateTimeOriginal);
QDateTime captureTime = metadata[2].value<QVariant>().value<QDateTime>();
QVERIFY(qAbs(captureTime.secsTo(QDateTime::currentDateTime()) < 5)); //it should not takes more than 5 seconds for signal to arrive here
const qint64 dt = captureTime.secsTo(QDateTime::currentDateTime());
QVERIFY2(qAbs(dt) < 5, QByteArray::number(dt).constData()); // it should not take more than 5 seconds for signal to arrive here
metadata = metadataSignal[2];
QCOMPARE(metadata[0].toInt(), id);