summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/image/qpixmapcache
diff options
context:
space:
mode:
authorSerge Lysenko <sergii.lysenko@avid.com>2015-08-21 19:58:49 +0300
committerSerge Lysenko <sergii.lysenko@avid.com>2015-09-18 13:48:05 +0000
commit8f68d15789c78c97a4cf1a2c85ec1753a2536032 (patch)
treeaa442e012c8942facecdcb0ccdb43b7beedfbced /tests/auto/gui/image/qpixmapcache
parent0d3464428e4632f3ec905766baf778d3355dd80c (diff)
Add method for checking of QPixmapCache::Key validity
We need a method to check whether a specified pixmap is still cached without touching the recently-accessed list for this pixmap. [ChangeLog][QtGui][QPixmapCache] Added QPixmapCache::Key::isValid(). Change-Id: I90fa4f67b569099b67b6207e78494beb3111b68e Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
Diffstat (limited to 'tests/auto/gui/image/qpixmapcache')
-rw-r--r--tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp b/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
index a3cf66da18..d1f76e8742 100644
--- a/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
+++ b/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
@@ -147,7 +147,7 @@ void tst_QPixmapCache::setCacheLimit()
QVERIFY(QPixmapCache::find(key, p1) == 0);
QPixmapCache::setCacheLimit(1000);
key = QPixmapCache::insert(*p1);
- QCOMPARE(getPrivate(key)->isValid, true);
+ QVERIFY(key.isValid());
QCOMPARE(getPrivate(key)->key, 1);
delete p1;
@@ -189,7 +189,7 @@ void tst_QPixmapCache::setCacheLimit()
key2 = QPixmapCache::insert(*p1);
QCOMPARE(getPrivate(key2)->key, 1);
//This old key is not valid anymore after the flush
- QCOMPARE(getPrivate(key)->isValid, false);
+ QVERIFY(!key.isValid());
QVERIFY(QPixmapCache::find(key, &p2) == 0);
delete p1;
}
@@ -233,7 +233,7 @@ void tst_QPixmapCache::find()
//at that time the first key has been erase because no more place in the cache
QVERIFY(QPixmapCache::find(key, &p1) == 0);
- QCOMPARE(getPrivate(key)->isValid, false);
+ QVERIFY(!key.isValid());
}
void tst_QPixmapCache::insert()
@@ -313,7 +313,7 @@ void tst_QPixmapCache::replace()
p2.fill(Qt::yellow);
QPixmapCache::Key key = QPixmapCache::insert(p1);
- QCOMPARE(getPrivate(key)->isValid, true);
+ QVERIFY(key.isValid());
QPixmap p3;
QVERIFY(QPixmapCache::find(key, &p3) == 1);
@@ -321,7 +321,7 @@ void tst_QPixmapCache::replace()
QPixmapCache::replace(key, p2);
QVERIFY(QPixmapCache::find(key, &p3) == 1);
- QCOMPARE(getPrivate(key)->isValid, true);
+ QVERIFY(key.isValid());
QCOMPARE(getPrivate(key)->key, 1);
QCOMPARE(p3.width(), 10);
@@ -438,7 +438,7 @@ void tst_QPixmapCache::clear()
for (int k = 0; k < numberOfKeys; ++k) {
QVERIFY(QPixmapCache::find(keys.at(k), &p1) == 0);
- QCOMPARE(getPrivate(keys[k])->isValid, false);
+ QVERIFY(!keys[k].isValid());
}
}