aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qquickmenu/tst_qquickmenu.cpp
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2020-06-05 10:28:16 +0200
committerMitch Curtis <mitch.curtis@qt.io>2020-06-18 13:09:57 +0200
commitce46d7374acd0ba46379618563e10e013d524841 (patch)
tree0e77c643fe6e309dc94b2b54bff0cfddf1f17e60 /tests/auto/qquickmenu/tst_qquickmenu.cpp
parent82cdac46bfbd672fae7c70d2cb8bf50b490e35e5 (diff)
QQuickApplicationHelper: don't use QTest macros outside test functions
This has no effect. Task-number: QTBUG-66320 Change-Id: Ie6efb26243178c4044ac0bc721c21ad89769c982 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 969a724352dfe3250efb871c70f9482d7b780165) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/auto/qquickmenu/tst_qquickmenu.cpp')
-rw-r--r--tests/auto/qquickmenu/tst_qquickmenu.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/qquickmenu/tst_qquickmenu.cpp b/tests/auto/qquickmenu/tst_qquickmenu.cpp
index 2fe47477..092f1b75 100644
--- a/tests/auto/qquickmenu/tst_qquickmenu.cpp
+++ b/tests/auto/qquickmenu/tst_qquickmenu.cpp
@@ -106,6 +106,7 @@ private slots:
void tst_QQuickMenu::defaults()
{
QQuickApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickMenu *emptyMenu = helper.appWindow->property("emptyMenu").value<QQuickMenu*>();
QCOMPARE(emptyMenu->isVisible(), false);
@@ -117,6 +118,7 @@ void tst_QQuickMenu::defaults()
void tst_QQuickMenu::count()
{
QQuickApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickMenu *menu = helper.window->property("emptyMenu").value<QQuickMenu*>();
QVERIFY(menu);
@@ -149,6 +151,7 @@ void tst_QQuickMenu::mouse()
QSKIP("Mouse hovering not functional on offscreen/minimal platforms");
QQuickApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
centerOnScreen(window);
@@ -244,6 +247,7 @@ void tst_QQuickMenu::mouse()
void tst_QQuickMenu::pressAndHold()
{
QQuickApplicationHelper helper(this, QLatin1String("pressAndHold.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -268,6 +272,7 @@ void tst_QQuickMenu::contextMenuKeyboard()
QSKIP("This platform only allows tab focus for text controls");
QQuickApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
centerOnScreen(window);
@@ -451,6 +456,7 @@ void tst_QQuickMenu::disabledMenuItemKeyNavigation()
QSKIP("This platform only allows tab focus for text controls");
QQuickApplicationHelper helper(this, QLatin1String("disabledMenuItemKeyNavigation.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
centerOnScreen(window);
@@ -515,6 +521,7 @@ void tst_QQuickMenu::mnemonics()
#endif
QQuickApplicationHelper helper(this, QLatin1String("mnemonics.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -562,6 +569,7 @@ void tst_QQuickMenu::menuButton()
QSKIP("This platform only allows tab focus for text controls");
QQuickApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
@@ -588,6 +596,7 @@ void tst_QQuickMenu::menuButton()
void tst_QQuickMenu::addItem()
{
QQuickApplicationHelper helper(this, QLatin1String("addItem.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -609,6 +618,7 @@ void tst_QQuickMenu::addItem()
void tst_QQuickMenu::menuSeparator()
{
QQuickApplicationHelper helper(this, QLatin1String("menuSeparator.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
centerOnScreen(window);
moveMouseAway(window);
@@ -686,6 +696,7 @@ void tst_QQuickMenu::menuSeparator()
void tst_QQuickMenu::repeater()
{
QQuickApplicationHelper helper(this, QLatin1String("repeater.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -730,6 +741,7 @@ void tst_QQuickMenu::repeater()
void tst_QQuickMenu::order()
{
QQuickApplicationHelper helper(this, QLatin1String("order.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -751,6 +763,7 @@ void tst_QQuickMenu::order()
void tst_QQuickMenu::popup()
{
QQuickApplicationHelper helper(this, QLatin1String("popup.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
centerOnScreen(window);
moveMouseAway(window);
@@ -907,6 +920,7 @@ void tst_QQuickMenu::popup()
void tst_QQuickMenu::actions()
{
QQuickApplicationHelper helper(this, QLatin1String("actions.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -975,6 +989,7 @@ void tst_QQuickMenu::actions()
void tst_QQuickMenu::removeTakeItem()
{
QQuickApplicationHelper helper(this, QLatin1String("removeTakeItem.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -1038,6 +1053,7 @@ void tst_QQuickMenu::subMenuMouse()
QFETCH(bool, cascade);
QQuickApplicationHelper helper(this, QLatin1String("subMenus.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
centerOnScreen(window);
moveMouseAway(window);
@@ -1144,6 +1160,7 @@ void tst_QQuickMenu::subMenuDisabledMouse()
QFETCH(bool, cascade);
QQuickApplicationHelper helper(this, QLatin1String("subMenuDisabled.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
centerOnScreen(window);
moveMouseAway(window);
@@ -1206,6 +1223,7 @@ void tst_QQuickMenu::subMenuKeyboard()
QFETCH(bool, mirrored);
QQuickApplicationHelper helper(this, QLatin1String("subMenus.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
centerOnScreen(window);
moveMouseAway(window);
@@ -1328,6 +1346,7 @@ void tst_QQuickMenu::subMenuDisabledKeyboard()
QFETCH(bool, mirrored);
QQuickApplicationHelper helper(this, QLatin1String("subMenuDisabled.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
centerOnScreen(window);
moveMouseAway(window);
@@ -1404,6 +1423,7 @@ void tst_QQuickMenu::subMenuPosition()
QFETCH(qreal, overlap);
QQuickApplicationHelper helper(this, QLatin1String("subMenus.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
// Ensure that the default size of the window fits three menus side by side.
@@ -1525,6 +1545,7 @@ void tst_QQuickMenu::subMenuPosition()
void tst_QQuickMenu::addRemoveSubMenus()
{
QQuickApplicationHelper helper(this, QLatin1String("subMenus.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -1595,6 +1616,7 @@ void tst_QQuickMenu::scrollable()
QFETCH(QString, qmlFilePath);
QQuickApplicationHelper helper(this, qmlFilePath);
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -1634,6 +1656,7 @@ void tst_QQuickMenu::disableWhenTriggered()
QFETCH(int, subMenuItemIndex);
QQuickApplicationHelper helper(this, QLatin1String("disableWhenTriggered.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -1689,6 +1712,7 @@ void tst_QQuickMenu::menuItemWidth()
QFETCH(bool, mirrored);
QQuickApplicationHelper helper(this, QLatin1String("menuItemWidths.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -1717,6 +1741,7 @@ void tst_QQuickMenu::menuItemWidthAfterMenuWidthChanged()
QFETCH(bool, mirrored);
QQuickApplicationHelper helper(this, QLatin1String("menuItemWidths.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -1761,6 +1786,7 @@ void tst_QQuickMenu::menuItemWidthAfterImplicitWidthChanged()
QFETCH(bool, mirrored);
QQuickApplicationHelper helper(this, QLatin1String("menuItemWidths.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -1791,6 +1817,7 @@ void tst_QQuickMenu::menuItemWidthAfterImplicitWidthChanged()
void tst_QQuickMenu::menuItemWidthAfterRetranslate()
{
QQuickApplicationHelper helper(this, QLatin1String("menuItemWidths.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));