diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-09-24 09:25:25 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-09-24 07:49:30 +0000 |
commit | 7183d08095f4598fc0f7702608bd726986bf1307 (patch) | |
tree | 0511abe7b7ef3f520e60ada656f0dcb9a2650057 /tests/auto/gui | |
parent | 7a8da57a637f7a0b94199bb0e19f97a53958a8f0 (diff) |
Tests: Harmonize code checking on platform name.
Use case insensitive comparison and static invocation
of QGuiApplication::platformName().
Change-Id: I8c197c7b4f0669f71c019fbcee09a0f03dfab399
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Diffstat (limited to 'tests/auto/gui')
5 files changed, 17 insertions, 17 deletions
diff --git a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp index eddf3fa826..5fbd3e96f8 100644 --- a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp +++ b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp @@ -155,7 +155,7 @@ void tst_QGuiApplication::focusObject() int argc = 0; QGuiApplication app(argc, 0); - if (qApp->platformName().toLower() == QLatin1String("wayland")) + if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) QSKIP("Wayland: This fails. Figure out why."); QObject obj1, obj2, obj3; @@ -326,7 +326,7 @@ void tst_QGuiApplication::changeFocusWindow() int argc = 0; QGuiApplication app(argc, 0); - if (qApp->platformName().toLower() == QLatin1String("wayland")) + if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) QSKIP("Wayland: This fails. Figure out why."); const QRect screenGeometry = QGuiApplication::primaryScreen()->availableVirtualGeometry(); diff --git a/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp b/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp index ab17edecb6..e3b71e40d1 100644 --- a/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp +++ b/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp @@ -191,7 +191,7 @@ void tst_qinputmethod::cursorRectangle() { QCOMPARE(qApp->inputMethod()->cursorRectangle(), QRectF()); - if (qApp->platformName().toLower() == QLatin1String("wayland")) + if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) QSKIP("Wayland: This fails. Figure out why."); DummyWindow window; @@ -289,10 +289,10 @@ void tst_qinputmethod::inputDirection() void tst_qinputmethod::inputMethodAccepted() { - if (qApp->platformName().toLower() == QLatin1String("wayland")) + if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) QSKIP("Wayland: This fails. Figure out why."); - if (qApp->platformName().toLower() == QLatin1String("xcb")) + if (!QGuiApplication::platformName().compare(QLatin1String("xcb"), Qt::CaseInsensitive)) QSKIP("XCB: depends on dedicated platform context."); InputItem disabledItem; diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index ccb8c759c6..2219306b81 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -286,7 +286,7 @@ void tst_QWindow::positioning() QSKIP("This platform does not support non-fullscreen windows"); } - if (qApp->platformName().toLower() == QLatin1String("wayland")) + if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) QSKIP("Wayland: This fails. Figure out why."); // Some platforms enforce minimum widths for windows, which can cause extra resize @@ -476,7 +476,7 @@ void tst_QWindow::isExposed() window.hide(); - if (qApp->platformName().toLower() == QLatin1String("wayland")) + if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) QSKIP("Wayland: This is flaky. Figure out why."); QCoreApplication::processEvents(); @@ -487,7 +487,7 @@ void tst_QWindow::isExposed() void tst_QWindow::isActive() { - if (qApp->platformName().toLower() == QLatin1String("wayland")) + if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) QSKIP("Wayland: This fails. Figure out why."); Window window; @@ -1134,7 +1134,7 @@ void tst_QWindow::close() void tst_QWindow::activateAndClose() { - if (qApp->platformName().toLower() == QLatin1String("wayland")) + if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) QSKIP("Wayland: This fails. Figure out why."); for (int i = 0; i < 10; ++i) { @@ -1388,7 +1388,7 @@ void tst_QWindow::tabletEvents() void tst_QWindow::windowModality_QTBUG27039() { - if (qApp->platformName().toLower() == QLatin1String("wayland")) + if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) QSKIP("Wayland: This fails. Figure out why."); QWindow parent; @@ -1483,7 +1483,7 @@ void tst_QWindow::mask() void tst_QWindow::initialSize() { - if (qApp->platformName().toLower() == QLatin1String("wayland")) + if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) QSKIP("Wayland: This fails. Figure out why."); QSize defaultSize(0,0); @@ -1524,7 +1524,7 @@ void tst_QWindow::initialSize() void tst_QWindow::modalDialog() { - if (qApp->platformName().toLower() == QLatin1String("wayland")) + if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) QSKIP("Wayland: This fails. Figure out why."); QWindow normalWindow; @@ -1550,7 +1550,7 @@ void tst_QWindow::modalDialog() void tst_QWindow::modalDialogClosingOneOfTwoModal() { - if (qApp->platformName().toLower() == QLatin1String("wayland")) + if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) QSKIP("Wayland: This fails. Figure out why."); QWindow normalWindow; @@ -1588,7 +1588,7 @@ void tst_QWindow::modalDialogClosingOneOfTwoModal() void tst_QWindow::modalWithChildWindow() { - if (qApp->platformName().toLower() == QLatin1String("wayland")) + if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) QSKIP("Wayland: This fails. Figure out why."); QWindow normalWindow; @@ -1622,7 +1622,7 @@ void tst_QWindow::modalWithChildWindow() void tst_QWindow::modalWindowModallity() { - if (qApp->platformName().toLower() == QLatin1String("wayland")) + if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) QSKIP("Wayland: This fails. Figure out why."); QWindow normal_window; diff --git a/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp b/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp index 48a15641b2..1cb7972cc6 100644 --- a/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp +++ b/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp @@ -288,7 +288,7 @@ void tst_QOpenGlConfig::testBugList() void tst_QOpenGlConfig::testDefaultWindowsBlacklist() { - if (qGuiApp->platformName() != QStringLiteral("windows")) + if (QGuiApplication::platformName().compare(QLatin1String("windows"), Qt::CaseInsensitive)) QSKIP("Only applicable to Windows"); QFile f(QStringLiteral(":/qt-project.org/windows/openglblacklists/default.json")); diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp index 84109441b9..93e308b96a 100644 --- a/tests/auto/gui/text/qfont/tst_qfont.cpp +++ b/tests/auto/gui/text/qfont/tst_qfont.cpp @@ -149,7 +149,7 @@ void tst_QFont::exactMatch() #endif - if (QGuiApplication::platformName() == QLatin1String("xcb")) { + if (!QGuiApplication::platformName().compare("xcb", Qt::CaseInsensitive)) { QVERIFY(QFont("sans").exactMatch()); QVERIFY(QFont("sans-serif").exactMatch()); QVERIFY(QFont("serif").exactMatch()); |