diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2014-01-24 14:49:08 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-29 10:18:42 +0100 |
commit | 04b7e053752be754676c2ede21f70f7a8caed0a7 (patch) | |
tree | a41215ce731e2acd840b39cb451bbad2c3f725b4 /tests | |
parent | 8bfd49d40fc4739be91cbe107aff9bb4c4c217af (diff) |
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>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/unit/qcamera/tst_qcamera.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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<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); |