From 04b7e053752be754676c2ede21f70f7a8caed0a7 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 24 Jan 2014 14:49:08 +0100 Subject: 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(const T &)' being compiled Change-Id: Ifd467b5536a0d386f592ae339129b3ebfb7b8838 Reviewed-by: Yoann Lopes --- tests/auto/unit/qcamera/tst_qcamera.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/auto/unit') diff --git a/tests/auto/unit/qcamera/tst_qcamera.cpp b/tests/auto/unit/qcamera/tst_qcamera.cpp index fdd282cae..248f80cc7 100644 --- a/tests/auto/unit/qcamera/tst_qcamera.cpp +++ b/tests/auto/unit/qcamera/tst_qcamera.cpp @@ -504,7 +504,8 @@ void tst_QCamera::testCameraCaptureMetadata() QCOMPARE(metadata[0].toInt(), id); QCOMPARE(metadata[1].toString(), QMediaMetaData::DateTimeOriginal); QDateTime captureTime = metadata[2].value().value(); - 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); -- cgit v1.2.3