diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2012-01-10 09:53:44 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-10 05:12:15 +0100 |
commit | 226a7c77cb35f33fc3b2d49bd9b75c86e429b580 (patch) | |
tree | cb149d66907ed5cf37a7870328eba0a78192bd09 /tests/auto | |
parent | 626223ca27e91e4819f89552d6720c1b6815af20 (diff) |
Improve QDateTimeEdit autotest.
Reinstate a check that was presumably disabled because it wasn't
checking for the right expected date. At present pressing Enter in a
QDateTimeEdit without changing the date still emits the dataChanged()
signal. By reinstating the test, we ensure that the behaviour can't
change by accident.
Change-Id: I1b766af6ced001a4191606247338dbc91049cb8d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp index 4ce77ddee9..6514ed589c 100644 --- a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp +++ b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp @@ -1063,15 +1063,15 @@ void tst_QDateTimeEdit::enterKey() QCOMPARE(testWidget->lineEdit()->selectedText(), QString("9")); QCOMPARE(testWidget->date(), QDate(2004, 5, 9)); + // Current behaviour is that pressing the Enter key in a QDateTimeEdit + // causes the dateChanged() signal to be emitted, even if the date + // wasn't actually changed. While this behaviour is questionable, + // we include this test so a change to the behaviour can't go unnoticed. QSignalSpy enterSpy(testWidget, SIGNAL(dateChanged(const QDate &))); QTest::keyClick(testWidget, Qt::Key_Enter); QCOMPARE(enterSpy.count(), 1); - -#if 0 QVariantList list = enterSpy.takeFirst(); - QCOMPARE(list.at(0).toDate(), QDate(2004, 9, 15)); -#endif - + QCOMPARE(list.at(0).toDate(), QDate(2004, 5, 9)); } void tst_QDateTimeEdit::specialValueText() |