summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2009-09-30 11:48:48 (GMT)
committerJanne Anttila <janne.anttila@digia.com>2009-09-30 11:48:48 (GMT)
commit849e46599f0751ba5994d036df140d10e76e223c (patch)
treeefe594b97527736abd5f457d42c7c1bb50cad39d
parent3cbde9651eab58c56b62d65b6fa4d9269bde0844 (diff)
downloadQt-849e46599f0751ba5994d036df140d10e76e223c.zip
Qt-849e46599f0751ba5994d036df140d10e76e223c.tar.gz
Qt-849e46599f0751ba5994d036df140d10e76e223c.tar.bz2
Fixed qdoublespinbox undoRedo test case for Symbian.
Symbian does not have keysequene associated to redo functionality. Changed the test so that it checks if key sequence is associated to needed functionality and if not test is skipped and warning printed. Reviewed-by: Aleksandar Sasha Babic
-rw-r--r--tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp30
1 files changed, 20 insertions, 10 deletions
diff --git a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp
index f4ea985..3d2fa42 100644
--- a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp
+++ b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp
@@ -936,19 +936,29 @@ void tst_QDoubleSpinBox::undoRedo()
//testing CTRL+Z (undo)
int val = QKeySequence(QKeySequence::Undo)[0];
- Qt::KeyboardModifiers mods = (Qt::KeyboardModifiers)(val & Qt::KeyboardModifierMask);
- QTest::keyClick(&spin, val & ~mods, mods);
- QCOMPARE(spin.value(), 0.0);
- QVERIFY(!spin.lineEdit()->isUndoAvailable());
- QVERIFY(spin.lineEdit()->isRedoAvailable());
+ if (val != 0) {
+ Qt::KeyboardModifiers mods = (Qt::KeyboardModifiers)(val & Qt::KeyboardModifierMask);
+ QTest::keyClick(&spin, val & ~mods, mods);
+ QCOMPARE(spin.value(), 0.0);
+ QVERIFY(!spin.lineEdit()->isUndoAvailable());
+ QVERIFY(spin.lineEdit()->isRedoAvailable());
+ } else {
+ QWARN("Undo not tested because no key sequence associated to QKeySequence::Redo");
+ }
+
//testing CTRL+Y (redo)
val = QKeySequence(QKeySequence::Redo)[0];
- mods = (Qt::KeyboardModifiers)(val & Qt::KeyboardModifierMask);
- QTest::keyClick(&spin, val & ~mods, mods);
- QCOMPARE(spin.value(), 1.0);
- QVERIFY(!spin.lineEdit()->isRedoAvailable());
- QVERIFY(spin.lineEdit()->isUndoAvailable());
+ if (val != 0) {
+ Qt::KeyboardModifiers mods = (Qt::KeyboardModifiers)(val & Qt::KeyboardModifierMask);
+ QTest::keyClick(&spin, val & ~mods, mods);
+ QCOMPARE(spin.value(), 1.0);
+ QVERIFY(!spin.lineEdit()->isRedoAvailable());
+ QVERIFY(spin.lineEdit()->isUndoAvailable());
+ } else {
+ QWARN("Redo not tested because no key sequence associated to QKeySequence::Redo");
+ }
+
spin.setValue(55.0);
QVERIFY(!spin.lineEdit()->isUndoAvailable());