diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-12-02 18:10:26 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-12-02 18:10:26 (GMT) |
commit | 78b2e552cca92859b2c126751ca5fc6fd83dd5cf (patch) | |
tree | d42ba4930fd4b3c17515504994b8ec02e486d2ab /tests/auto/qdoublespinbox | |
parent | ac94288ba71722981894fc7577b781aa76d5f7de (diff) | |
download | Qt-78b2e552cca92859b2c126751ca5fc6fd83dd5cf.zip Qt-78b2e552cca92859b2c126751ca5fc6fd83dd5cf.tar.gz Qt-78b2e552cca92859b2c126751ca5fc6fd83dd5cf.tar.bz2 |
Stabilize tests on X11
Diffstat (limited to 'tests/auto/qdoublespinbox')
-rw-r--r-- | tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp index 157c39d..7f03153 100644 --- a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp +++ b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp @@ -1065,17 +1065,20 @@ void tst_QDoubleSpinBox::taskQTBUG_5008_textFromValueAndValidate() //we use the French delimiters here QString textFromValue (double value) const - { + { return locale().toString(value); } } spinbox; spinbox.show(); spinbox.activateWindow(); spinbox.setFocus(); + QApplication::setActiveWindow(&spinbox); QTest::qWaitForWindowShown(&spinbox); - QCOMPARE(spinbox.text(), spinbox.locale().toString(spinbox.value())); + QTRY_VERIFY(spinbox.hasFocus()); + QTRY_COMPARE(static_cast<QWidget *>(&spinbox), QApplication::activeWindow()); + QCOMPARE(spinbox.text(), spinbox.locale().toString(spinbox.value())); spinbox.lineEdit()->setCursorPosition(2); //just after the first thousand separator - QTest::keyClick(0, Qt::Key_0); // let's insert a 0 + QTest::keyClick(0, Qt::Key_0); // let's insert a 0 QCOMPARE(spinbox.value(), 10000.); spinbox.clearFocus(); //make sure the value is correctly formatted QCOMPARE(spinbox.text(), spinbox.locale().toString(spinbox.value())); |