From 752c0d7de0fb92124e2251a19841e308c6874159 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 24 Jul 2015 15:39:39 +0200 Subject: tests/corelib: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b). - Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer). - Replace Q[TRY]_VERIFY(smartPointer == 0) by Q[TRY]_VERIFY(smartPointer.isNull()). - Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) and add casts where necessary. The values will then be logged should a test fail. Tests from corelib/tools were omitted in this change. Change-Id: I4c8786d33fcf429d11b2b624c7cd89c28cadb518 Reviewed-by: Thiago Macieira --- .../corelib/io/qstorageinfo/tst_qstorageinfo.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'tests/auto/corelib/io/qstorageinfo') diff --git a/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp b/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp index a7a0cf4ddb..57bb81be61 100644 --- a/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp +++ b/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp @@ -61,9 +61,9 @@ void tst_QStorageInfo::defaultValues() QVERIFY(!storage.isRoot()); QVERIFY(storage.device().isEmpty()); QVERIFY(storage.fileSystemType().isEmpty()); - QVERIFY(storage.bytesTotal() == -1); - QVERIFY(storage.bytesFree() == -1); - QVERIFY(storage.bytesAvailable() == -1); + QCOMPARE(storage.bytesTotal(), -1); + QCOMPARE(storage.bytesFree(), -1); + QCOMPARE(storage.bytesAvailable(), -1); } void tst_QStorageInfo::operatorEqual() @@ -71,19 +71,19 @@ void tst_QStorageInfo::operatorEqual() { QStorageInfo storage1 = QStorageInfo::root(); QStorageInfo storage2(QDir::rootPath()); - QVERIFY(storage1 == storage2); + QCOMPARE(storage1, storage2); } { QStorageInfo storage1(QCoreApplication::applicationDirPath()); QStorageInfo storage2(QCoreApplication::applicationFilePath()); - QVERIFY(storage1 == storage2); + QCOMPARE(storage1, storage2); } { QStorageInfo storage1; QStorageInfo storage2; - QVERIFY(storage1 == storage2); + QCOMPARE(storage1, storage2); } } @@ -184,15 +184,15 @@ void tst_QStorageInfo::caching() qint64 free = storage1.bytesFree(); QStorageInfo storage2(storage1); - QVERIFY(free == storage2.bytesFree()); + QCOMPARE(free, storage2.bytesFree()); file.write(QByteArray(1024*1024, '\0')); file.flush(); - QVERIFY(free == storage1.bytesFree()); - QVERIFY(free == storage2.bytesFree()); + QCOMPARE(free, storage1.bytesFree()); + QCOMPARE(free, storage2.bytesFree()); storage2.refresh(); - QVERIFY(storage1 == storage2); + QCOMPARE(storage1, storage2); QVERIFY(free != storage2.bytesFree()); } #endif -- cgit v1.2.3