summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-10-31 16:36:42 +1000
committerQt by Nokia <qt-info@nokia.com>2011-11-01 00:25:34 +0100
commit9a9d2e8ba29a0d36e78489aec30479fadf8d3fba (patch)
tree3175aebe40e87fecc8b6a62e3c81c480177206a8 /tests/auto
parent0ad18e18d1223b173d4a0d374b70ec08c3b22b11 (diff)
Improve QMenu autotest
The test for keyboard navigation was only checking correct highlighting when a menu item was not activated by the latest key-click. It should also check that no item is highlighted after an item is activated. Change-Id: I443e154be5cdc2def4f12d3f0abab2cc1bc6e4a8 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
index ef50a52953..61bbd5449d 100644
--- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
+++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
@@ -360,9 +360,12 @@ void tst_QMenu::keyboardNavigation()
QCOMPARE(menus[expected_menu]->activeAction(), (QAction *)0);
} else {
QCOMPARE(menus[expected_menu]->activeAction(), builtins[expected_action]);
- if (expected_highlighted)
- QCOMPARE(menus[expected_menu]->activeAction(), highlighted);
}
+
+ if (expected_highlighted)
+ QCOMPARE(menus[expected_menu]->activeAction(), highlighted);
+ else
+ QCOMPARE(highlighted, (QAction *)0);
}
#ifdef Q_WS_MAC