summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpixmapcache
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@nokia.com>2009-05-26 13:26:14 +0200
committerAlexis Menard <alexis.menard@nokia.com>2009-05-26 13:27:32 +0200
commitf552dc200d857505df500b3ce0b99d5f7c74c951 (patch)
tree497cfe224bcf495c6d10c09592dca675a2d12fd6 /tests/auto/qpixmapcache
parentc666b88abcb2c5c120054ac3b0d304cd8225ded7 (diff)
We first remove the pixmap from the cache and then release the key
If we don't remove the pixmap from QCache first then the key is invalid and the removal failed Reviewed-by: sroedal
Diffstat (limited to 'tests/auto/qpixmapcache')
-rw-r--r--tests/auto/qpixmapcache/tst_qpixmapcache.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qpixmapcache/tst_qpixmapcache.cpp b/tests/auto/qpixmapcache/tst_qpixmapcache.cpp
index 405ac34bd0..fb5998a44c 100644
--- a/tests/auto/qpixmapcache/tst_qpixmapcache.cpp
+++ b/tests/auto/qpixmapcache/tst_qpixmapcache.cpp
@@ -369,6 +369,14 @@ void tst_QPixmapCache::remove()
key = QPixmapCache::insert(p1);
QCOMPARE(getPrivate(key)->key, 1);
+ //Test if pixmaps are correctly deleted
+ QPixmapCache::clear();
+ key = QPixmapCache::insert(p1);
+ QCOMPARE(getPrivate(key)->key, 1);
+ QVERIFY(QPixmapCache::find(key, &p1) != 0);
+ QPixmapCache::remove(key);
+ QCOMPARE(p1.isDetached(), true);
+
//We mix both part of the API
QPixmapCache::clear();
p1.fill(Qt::red);