summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/image
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-03-13 09:50:43 +0100
committerUlf Hermann <ulf.hermann@qt.io>2017-03-13 15:55:44 +0100
commitd51c3ecf8ef6e28557c66745f50a223cc5b1ce54 (patch)
tree023a1ecaa944152e08ba11291ec7aadc12f59dad /tests/auto/gui/image
parentf06f1adb6cc3835793a15eafa2d5a3affad712a2 (diff)
parent3a1f4b186d8ce79717da37f808ff9a4b3e949d9c (diff)
Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts: examples/network/network.pro mkspecs/features/mac/default_post.prf src/corelib/io/qfilesystemengine_win.cpp src/corelib/io/qprocess.cpp src/corelib/io/qprocess.h src/corelib/io/qprocess_p.h src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/corelib/thread/qmutex.cpp src/platformsupport/fontdatabases/windows/windows.pri src/plugins/platforms/eglfs/eglfsdeviceintegration.pro tests/auto/corelib/io/io.pro Change-Id: I8a27e0e141454818bba9c433200a4e84a88d147e
Diffstat (limited to 'tests/auto/gui/image')
-rw-r--r--tests/auto/gui/image/qicon/tst_qicon.cpp4
-rw-r--r--tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp11
2 files changed, 13 insertions, 2 deletions
diff --git a/tests/auto/gui/image/qicon/tst_qicon.cpp b/tests/auto/gui/image/qicon/tst_qicon.cpp
index 4218d0751f..d628fad705 100644
--- a/tests/auto/gui/image/qicon/tst_qicon.cpp
+++ b/tests/auto/gui/image/qicon/tst_qicon.cpp
@@ -709,7 +709,7 @@ void tst_QIcon::fromThemeCache()
QIcon::setThemeSearchPaths(QStringList());
QSKIP("gtk-update-icon-cache not run (binary not found)");
}
-#ifndef QT_NO_PROCESS
+#if QT_CONFIG(process)
QProcess process;
process.start(gtkUpdateIconCache,
QStringList() << QStringLiteral("-f") << QStringLiteral("-t") << (dir.path() + QLatin1String("/testcache")));
@@ -719,7 +719,7 @@ void tst_QIcon::fromThemeCache()
QVERIFY(process.waitForFinished());
QCOMPARE(process.exitStatus(), QProcess::NormalExit);
QCOMPARE(process.exitCode(), 0);
-#endif // QT_NO_PROCESS
+#endif // QT_CONFIG(process)
QVERIFY(QFileInfo(cacheName).lastModified() >= QFileInfo(dir.path() + QLatin1String("/testcache/16x16/actions")).lastModified());
QIcon::setThemeSearchPaths(QStringList() << dir.path()); // reload themes
QVERIFY(!QIcon::fromTheme("button-open").isNull());
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"