diff options
Diffstat (limited to 'tests/auto/gui/image')
-rw-r--r-- | tests/auto/gui/image/qicon/tst_qicon.cpp | 10 | ||||
-rw-r--r-- | tests/auto/gui/image/qimage/tst_qimage.cpp | 10 | ||||
-rw-r--r-- | tests/auto/gui/image/qimagereader/tst_qimagereader.cpp | 8 | ||||
-rw-r--r-- | tests/auto/gui/image/qmovie/tst_qmovie.cpp | 4 | ||||
-rw-r--r-- | tests/auto/gui/image/qpixmap/tst_qpixmap.cpp | 22 | ||||
-rw-r--r-- | tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp | 10 |
6 files changed, 32 insertions, 32 deletions
diff --git a/tests/auto/gui/image/qicon/tst_qicon.cpp b/tests/auto/gui/image/qicon/tst_qicon.cpp index 32e5d7a841..9ed3873682 100644 --- a/tests/auto/gui/image/qicon/tst_qicon.cpp +++ b/tests/auto/gui/image/qicon/tst_qicon.cpp @@ -348,10 +348,10 @@ void tst_QIcon::cacheKey() qint64 icon1_key = icon1.cacheKey(); QIcon icon2 = icon1; - QVERIFY(icon2.cacheKey() == icon1.cacheKey()); + QCOMPARE(icon2.cacheKey(), icon1.cacheKey()); icon2.detach(); QVERIFY(icon2.cacheKey() != icon1.cacheKey()); - QVERIFY(icon1.cacheKey() == icon1_key); + QCOMPARE(icon1.cacheKey(), icon1_key); } void tst_QIcon::detach() @@ -368,7 +368,7 @@ void tst_QIcon::detach() img1 = icon1.pixmap(32, 32).toImage(); img2 = icon2.pixmap(32, 32).toImage(); - QVERIFY(img1 == img2); + QCOMPARE(img1, img2); } void tst_QIcon::addFile() @@ -556,7 +556,7 @@ void tst_QIcon::fromTheme() QString firstSearchPath = QLatin1String(":/icons"); QString secondSearchPath = QLatin1String(":/second_icons"); QIcon::setThemeSearchPaths(QStringList() << firstSearchPath << secondSearchPath); - QVERIFY(QIcon::themeSearchPaths().size() == 2); + QCOMPARE(QIcon::themeSearchPaths().size(), 2); QCOMPARE(firstSearchPath, QIcon::themeSearchPaths()[0]); QCOMPARE(secondSearchPath, QIcon::themeSearchPaths()[1]); @@ -593,7 +593,7 @@ void tst_QIcon::fromTheme() // Test non existing icon with fallback noIcon = QIcon::fromTheme("broken-icon", abIcon); - QVERIFY(noIcon.cacheKey() == abIcon.cacheKey()); + QCOMPARE(noIcon.cacheKey(), abIcon.cacheKey()); // Test svg-only icon noIcon = QIcon::fromTheme("svg-icon", abIcon); diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp index f7c71f05bd..c1b32a273c 100644 --- a/tests/auto/gui/image/qimage/tst_qimage.cpp +++ b/tests/auto/gui/image/qimage/tst_qimage.cpp @@ -477,7 +477,7 @@ void tst_QImage::setAlphaChannel() image.setAlphaChannel(alphaChannel); image = image.convertToFormat(QImage::Format_ARGB32); - QVERIFY(image.format() == QImage::Format_ARGB32); + QCOMPARE(image.format(), QImage::Format_ARGB32); // alpha of 0 becomes black at a=0 due to premultiplication QRgb pixel = alpha == 0 ? 0 : qRgba(red, green, blue, alpha); @@ -1564,12 +1564,12 @@ void tst_QImage::createHeuristicMask() // line 2 QVERIFY(newMask.pixel(0,1) != newMask.pixel(1,1)); - QVERIFY(newMask.pixel(1,1) == newMask.pixel(2,1)); + QCOMPARE(newMask.pixel(1,1), newMask.pixel(2,1)); QVERIFY(newMask.pixel(2,1) != newMask.pixel(3,1)); // line 3 QVERIFY(newMask.pixel(0,2) != newMask.pixel(1,2)); - QVERIFY(newMask.pixel(1,2) == newMask.pixel(2,2)); + QCOMPARE(newMask.pixel(1,2), newMask.pixel(2,2)); QVERIFY(newMask.pixel(2,2) != newMask.pixel(3,2)); } #endif @@ -1580,10 +1580,10 @@ void tst_QImage::cacheKey() qint64 image1_key = image1.cacheKey(); QImage image2 = image1; - QVERIFY(image2.cacheKey() == image1.cacheKey()); + QCOMPARE(image2.cacheKey(), image1.cacheKey()); image2.detach(); QVERIFY(image2.cacheKey() != image1.cacheKey()); - QVERIFY(image1.cacheKey() == image1_key); + QCOMPARE(image1.cacheKey(), image1_key); } void tst_QImage::smoothScale() diff --git a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp index 4b3e2606fd..07b75adae4 100644 --- a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp @@ -733,7 +733,7 @@ void tst_QImageReader::gifHandlerBugs() QVERIFY(io.loopCount() != 1); int count=0; for (; io.canRead(); io.read(), ++count) ; - QVERIFY(count == 34); + QCOMPARE(count, 34); } // Task 95166 @@ -810,7 +810,7 @@ void tst_QImageReader::gifImageCount() QVERIFY(io.canRead()); QImage greenFrame = io.read(); - QVERIFY(io.imageCount() == 4); + QCOMPARE(io.imageCount(), 4); QVERIFY(io.canRead()); QImage blueFrame = io.read(); @@ -925,8 +925,8 @@ void tst_QImageReader::gifImageCount() } { QImageReader io(":images/trolltech.gif"); - QVERIFY(io.imageCount() == 34); - QVERIFY(io.size() == QSize(128,64)); + QCOMPARE(io.imageCount(), 34); + QCOMPARE(io.size(), QSize(128,64)); } } diff --git a/tests/auto/gui/image/qmovie/tst_qmovie.cpp b/tests/auto/gui/image/qmovie/tst_qmovie.cpp index acefd0944e..b8c99ca324 100644 --- a/tests/auto/gui/image/qmovie/tst_qmovie.cpp +++ b/tests/auto/gui/image/qmovie/tst_qmovie.cpp @@ -189,7 +189,7 @@ void tst_QMovie::jumpToFrame() movie.start(); movie.stop(); QVERIFY(!movie.jumpToFrame(-1)); - QVERIFY(movie.currentFrameNumber() == 0); + QCOMPARE(movie.currentFrameNumber(), 0); } void tst_QMovie::changeMovieFile() @@ -198,7 +198,7 @@ void tst_QMovie::changeMovieFile() movie.start(); movie.stop(); movie.setFileName(QFINDTESTDATA("animations/trolltech.gif")); - QVERIFY(movie.currentFrameNumber() == -1); + QCOMPARE(movie.currentFrameNumber(), -1); } #ifndef QT_NO_WIDGETS diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp index b31fb0138f..67d7e57fd4 100644 --- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp @@ -447,7 +447,7 @@ void tst_QPixmap::scroll() QString fileName = QString(":/images/%1.png").arg(QTest::currentDataTag()); QPixmap output(fileName); - QVERIFY(input.isNull() == output.isNull()); + QCOMPARE(input.isNull(), output.isNull()); QVERIFY(lenientCompare(pixmap, output)); QCOMPARE(exp, exposed); } @@ -713,11 +713,11 @@ void tst_QPixmap::cacheKey() QVERIFY(pixmap1.cacheKey() != pixmap2.cacheKey()); pixmap2 = pixmap1; - QVERIFY(pixmap2.cacheKey() == pixmap1.cacheKey()); + QCOMPARE(pixmap2.cacheKey(), pixmap1.cacheKey()); pixmap2.detach(); QVERIFY(pixmap2.cacheKey() != pixmap1.cacheKey()); - QVERIFY(pixmap1.cacheKey() == pixmap1_key); + QCOMPARE(pixmap1.cacheKey(), pixmap1_key); } // Test drawing a bitmap on a pixmap. @@ -783,11 +783,11 @@ void tst_QPixmap::convertFromImageNoDetach() QPixmap pix = QPixmap::fromImage(orig); QImage copy = pix.toImage(); - QVERIFY(copy.format() == screenFormat); + QCOMPARE(copy.format(), screenFormat); const QImage constOrig = orig; const QImage constCopy = copy; - QVERIFY(constOrig.bits() == constCopy.bits()); + QCOMPARE(constOrig.bits(), constCopy.bits()); } void tst_QPixmap::convertFromImageDetach() @@ -821,7 +821,7 @@ void tst_QPixmap::convertFromImageCacheKey() QPixmap pix = QPixmap::fromImage(orig); QImage copy = pix.toImage(); - QVERIFY(copy.format() == screenFormat); + QCOMPARE(copy.format(), screenFormat); QCOMPARE(orig.cacheKey(), pix.cacheKey()); QCOMPARE(copy.cacheKey(), pix.cacheKey()); @@ -1135,9 +1135,9 @@ void tst_QPixmap::copy() void tst_QPixmap::depthOfNullObjects() { QBitmap b1; - QVERIFY(b1.depth() == 0); + QCOMPARE(b1.depth(), 0); QPixmap p4; - QVERIFY(p4.depth() == 0); + QCOMPARE(p4.depth(), 0); } void tst_QPixmap::transformed() @@ -1437,7 +1437,7 @@ void tst_QPixmap::task_246446() { QPixmap pm2(pm); } - QVERIFY(pm.width() == 10); + QCOMPARE(pm.width(), 10); QVERIFY(pm.mask().isNull()); } @@ -1490,14 +1490,14 @@ void tst_QPixmap::loadAsBitmapOrPixmap() // The do the same check for bitmaps.. QBitmap bitmap("temp_image.png"); QVERIFY(!bitmap.isNull()); - QVERIFY(bitmap.depth() == 1); + QCOMPARE(bitmap.depth(), 1); QVERIFY(bitmap.isQBitmap()); bitmap = QBitmap(); ok = bitmap.load("temp_image.png"); QVERIFY(ok); QVERIFY(!bitmap.isNull()); - QVERIFY(bitmap.depth() == 1); + QCOMPARE(bitmap.depth(), 1); QVERIFY(bitmap.isQBitmap()); } diff --git a/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp b/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp index f22aa63112..a3cf66da18 100644 --- a/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp +++ b/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp @@ -111,7 +111,7 @@ void tst_QPixmapCache::setCacheLimit() delete p1; QPixmapCache::setCacheLimit(0); - QVERIFY(QPixmapCache::find("P1") == 0); + QVERIFY(!QPixmapCache::find("P1")); p1 = new QPixmap(2, 3); QPixmapCache::setCacheLimit(1000); @@ -346,12 +346,12 @@ void tst_QPixmapCache::remove() QVERIFY(p1.toImage() == p1.toImage()); // sanity check QPixmapCache::remove("red"); - QVERIFY(QPixmapCache::find("red") == 0); + QVERIFY(!QPixmapCache::find("red")); QPixmapCache::remove("red"); - QVERIFY(QPixmapCache::find("red") == 0); + QVERIFY(!QPixmapCache::find("red")); QPixmapCache::remove("green"); - QVERIFY(QPixmapCache::find("green") == 0); + QVERIFY(!QPixmapCache::find("green")); //The int part of the API QPixmapCache::clear(); @@ -424,7 +424,7 @@ void tst_QPixmapCache::clear() QPixmapCache::clear(); for (int k = 0; k < numberOfKeys; ++k) - QVERIFY(QPixmapCache::find(QString::number(k)) == 0); + QVERIFY(!QPixmapCache::find(QString::number(k))); //The int part of the API QPixmap p2(10, 10); |