summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp')
-rw-r--r--tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp46
1 files changed, 3 insertions, 43 deletions
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
index b7e8cded7a..f942f78b1d 100644
--- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
+++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
@@ -52,15 +52,9 @@
#include <QtWidgets/private/qapplication_p.h>
#include <QtWidgets/QStyle>
-#ifdef Q_OS_WINCE
-#include <windows.h>
-#endif
-
#include <qpa/qwindowsysteminterface.h>
#include <private/qhighdpiscaling_p.h>
-#include "../../../qtest-config.h"
-
QT_BEGIN_NAMESPACE
static QWindowSystemInterface::TouchPoint touchPoint(const QTouchEvent::TouchPoint& pt)
{
@@ -235,10 +229,6 @@ static char *argv0;
tst_QApplication::tst_QApplication()
: quitApplicationTriggered(false)
{
-#ifdef Q_OS_WINCE
- // Clean up environment previously to launching test
- qputenv("QT_PLUGIN_PATH", QByteArray());
-#endif
}
void tst_QApplication::cleanup()
@@ -897,19 +887,8 @@ bool isPathListIncluded(const QStringList &l, const QStringList &r)
#define QT_TST_QAPP_DEBUG
void tst_QApplication::libraryPaths()
{
-#ifndef Q_OS_WINCE
const QString testDir = QFileInfo(QFINDTESTDATA("test/test.pro")).absolutePath();
QVERIFY(!testDir.isEmpty());
-#else // !Q_OS_WINCE
- // On Windows CE we need QApplication object to have valid
- // current Path. Therefore we need to identify it ourselves
- // here for the test.
- QFileInfo filePath;
- wchar_t module_name[MAX_PATH];
- GetModuleFileName(0, module_name, MAX_PATH);
- filePath = QString::fromWCharArray(module_name);
- const QString testDir = filePath.path() + "/test";
-#endif // Q_OS_WINCE
{
QApplication::setLibraryPaths(QStringList() << testDir);
QCOMPARE(QApplication::libraryPaths(), (QStringList() << testDir));
@@ -1000,11 +979,7 @@ void tst_QApplication::libraryPaths()
QString appDirPath = app.applicationDirPath();
app.addLibraryPath(appDirPath);
-#ifdef Q_OS_WINCE
- app.addLibraryPath(appDirPath + "/../..");
-#else
app.addLibraryPath(appDirPath + "/..");
-#endif
#ifdef QT_TST_QAPP_DEBUG
qDebug() << "appDirPath" << appDirPath;
qDebug() << "After adding appDirPath && appDirPath + /..:" << app.libraryPaths();
@@ -1044,15 +1019,9 @@ void tst_QApplication::libraryPaths_qt_plugin_path_2()
QByteArray nonExistentPath = "/nonexistent";
QByteArray pluginPath = validPath + ':' + nonExistentPath;
#elif defined(Q_OS_WIN)
-# ifdef Q_OS_WINCE
- QByteArray validPath = "/Temp";
- QByteArray nonExistentPath = "/nonexistent";
- QByteArray pluginPath = validPath + ';' + nonExistentPath;
-# else
QByteArray validPath = "C:\\windows";
QByteArray nonExistentPath = "Z:\\nonexistent";
QByteArray pluginPath = validPath + ';' + nonExistentPath;
-# endif
#endif
{
@@ -1069,9 +1038,7 @@ void tst_QApplication::libraryPaths_qt_plugin_path_2()
<< QLibraryInfo::location(QLibraryInfo::PluginsPath)
<< QDir(app.applicationDirPath()).canonicalPath()
<< QDir(QDir::fromNativeSeparators(QString::fromLatin1(validPath))).canonicalPath();
-# ifdef Q_OS_WINCE
- expected = QSet<QString>::fromList(expected).toList();
-# endif
+
QVERIFY2(isPathListIncluded(app.libraryPaths(), expected),
qPrintable("actual:\n - " + app.libraryPaths().join("\n - ") +
"\nexpected:\n - " + expected.join("\n - ")));
@@ -1091,9 +1058,6 @@ void tst_QApplication::libraryPaths_qt_plugin_path_2()
QStringList()
<< QLibraryInfo::location(QLibraryInfo::PluginsPath)
<< app.applicationDirPath();
-# ifdef Q_OS_WINCE
- expected = QSet<QString>::fromList(expected).toList();
-# endif
QVERIFY(isPathListIncluded(app.libraryPaths(), expected));
qputenv("QT_PLUGIN_PATH", QByteArray());
@@ -1479,10 +1443,6 @@ void tst_QApplication::desktopSettingsAware()
}
QVERIFY2(!path.isEmpty(), "Cannot locate desktopsettingsaware helper application");
path += "desktopsettingsaware";
-#ifdef Q_OS_WINCE
- int argc = 0;
- QApplication tmpApp(argc, 0);
-#endif
QProcess testProcess;
testProcess.start(path);
QVERIFY2(testProcess.waitForStarted(),
@@ -2331,7 +2291,7 @@ Q_GLOBAL_STATIC(QPixmap, tst_qapp_pixmap);
Q_GLOBAL_STATIC(QFont, tst_qapp_font);
Q_GLOBAL_STATIC(QRegion, tst_qapp_region);
Q_GLOBAL_STATIC(QFontDatabase, tst_qapp_fontDatabase);
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
Q_GLOBAL_STATIC(QCursor, tst_qapp_cursor);
#endif
@@ -2356,7 +2316,7 @@ void tst_QApplication::globalStaticObjectDestruction()
QVERIFY(tst_qapp_font());
QVERIFY(tst_qapp_region());
QVERIFY(tst_qapp_fontDatabase());
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
QVERIFY(tst_qapp_cursor());
#endif
}