aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qquickmenu
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-17 14:47:52 +0000
commit969a724352dfe3250efb871c70f9482d7b780165 (patch)
tree06b27357c617e90804b1f3644bacb3775fd807fe /tests/auto/qquickmenu
parent602bffd346f0427e0ee3a928af5c404d806ef3b6 (diff)
QQuickApplicationHelper: don't use QTest macros outside test functions
This has no effect. Task-number: QTBUG-66320 Pick-to: 5.15 5.12 Change-Id: Ie6efb26243178c4044ac0bc721c21ad89769c982 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'tests/auto/qquickmenu')
-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 37d1e5ac..9d29c675 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);
@@ -247,6 +250,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();
@@ -271,6 +275,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);
@@ -456,6 +461,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);
@@ -520,6 +526,7 @@ void tst_QQuickMenu::mnemonics()
#endif
QQuickApplicationHelper helper(this, QLatin1String("mnemonics.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -567,6 +574,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();
@@ -593,6 +601,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));
@@ -614,6 +623,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);
@@ -691,6 +701,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));
@@ -735,6 +746,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));
@@ -756,6 +768,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);
@@ -912,6 +925,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));
@@ -980,6 +994,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));
@@ -1037,6 +1052,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);
@@ -1143,6 +1159,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);
@@ -1205,6 +1222,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);
@@ -1327,6 +1345,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);
@@ -1403,6 +1422,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.
@@ -1524,6 +1544,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));