summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp')
-rw-r--r--tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp b/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
index 8dcf104035..8a2a35f86c 100644
--- a/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
+++ b/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
@@ -56,6 +56,7 @@ private slots:
void pixmapKey();
void noLeak();
void strictCacheLimit();
+ void noCrashOnLargeInsert();
};
static QPixmapCache::KeyData* getPrivate(QPixmapCache::Key &key)
@@ -525,5 +526,15 @@ void tst_QPixmapCache::strictCacheLimit()
QVERIFY(QPixmapCache::totalUsed() <= limit);
}
+void tst_QPixmapCache::noCrashOnLargeInsert()
+{
+ QPixmapCache::clear();
+ QPixmapCache::setCacheLimit(100);
+ QPixmap pixmap(500, 500);
+ pixmap.fill(Qt::transparent);
+ QPixmapCache::insert("test", pixmap);
+ QVERIFY(true); // no crash
+}
+
QTEST_MAIN(tst_QPixmapCache)
#include "tst_qpixmapcache.moc"