summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui')
-rw-r--r--tests/auto/gui/image/qicon/tst_qicon.cpp4
-rw-r--r--tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp11
-rw-r--r--tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp16
-rw-r--r--tests/auto/gui/text/qfont/tst_qfont.cpp2
4 files changed, 22 insertions, 11 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"
diff --git a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
index b1ec94403a..87fd5c0dc6 100644
--- a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
+++ b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
@@ -73,7 +73,7 @@ void tst_QClipboard::cleanupTestCase()
void tst_QClipboard::init()
{
-#ifndef QT_NO_PROCESS
+#if QT_CONFIG(process)
const QString testdataDir = QFileInfo(QFINDTESTDATA("copier")).absolutePath();
QVERIFY2(QDir::setCurrent(testdataDir), qPrintable("Could not chdir to " + testdataDir));
#endif
@@ -218,7 +218,7 @@ void tst_QClipboard::testSignals()
#if defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(Q_OS_QNX)
static bool runHelper(const QString &program, const QStringList &arguments, QByteArray *errorMessage)
{
-#ifndef QT_NO_PROCESS
+#if QT_CONFIG(process)
QProcess process;
process.setReadChannelMode(QProcess::ForwardedChannels);
process.start(program, arguments);
@@ -254,19 +254,19 @@ static bool runHelper(const QString &program, const QStringList &arguments, QByt
return false;
}
return true;
-#else // QT_NO_PROCESS
+#else // QT_CONFIG(process)
Q_UNUSED(program)
Q_UNUSED(arguments)
Q_UNUSED(errorMessage)
return false;
-#endif // QT_NO_PROCESS
+#endif // QT_CONFIG(process)
}
// Test that pasted text remains on the clipboard after a Qt application exits.
// This test does not make sense on X11 and embedded, copied data disappears from the clipboard when the application exits
void tst_QClipboard::copy_exit_paste()
{
-#ifndef QT_NO_PROCESS
+#if QT_CONFIG(process)
// ### It's still possible to test copy/paste - just keep the apps running
if (!PlatformClipboard::isAvailable())
QSKIP("Native clipboard not working in this setup");
@@ -282,12 +282,12 @@ void tst_QClipboard::copy_exit_paste()
QStringList() << QStringLiteral("--text") << stringArgument,
&errorMessage),
errorMessage.constData());
-#endif // QT_NO_PROCESS
+#endif // QT_CONFIG(process)
}
void tst_QClipboard::copyImage()
{
-#ifndef QT_NO_PROCESS
+#if QT_CONFIG(process)
if (!PlatformClipboard::isAvailable())
QSKIP("Native clipboard not working in this setup");
QImage image(100, 100, QImage::Format_ARGB32);
@@ -303,7 +303,7 @@ void tst_QClipboard::copyImage()
QVERIFY2(runHelper(QStringLiteral("paster/paster"),
QStringList(QStringLiteral("--image")), &errorMessage),
errorMessage.constData());
-#endif // QT_NO_PROCESS
+#endif // QT_CONFIG(process)
}
#endif // Q_OS_WIN || Q_OS_MAC || Q_OS_QNX
diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp
index 2603206ab0..1f826c01cf 100644
--- a/tests/auto/gui/text/qfont/tst_qfont.cpp
+++ b/tests/auto/gui/text/qfont/tst_qfont.cpp
@@ -486,7 +486,7 @@ void tst_QFont::styleName()
QString getPlatformGenericFont(const char* genericName)
{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_FONTCONFIG)
+#if defined(Q_OS_UNIX) && !defined(QT_NO_FONTCONFIG) && QT_CONFIG(process)
QProcess p;
p.start(QLatin1String("fc-match"), (QStringList() << "-f%{family}" << genericName));
if (!p.waitForStarted())