diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-04-12 04:53:36 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2011-04-12 05:38:20 (GMT) |
commit | 3475168550c1a804f04f2a4edfeb30c04cd36551 (patch) | |
tree | ec1587bdc87e6f554c31e09cb1a3a2e26f16b181 /tests/auto/qinputdialog | |
parent | 78722d6b6e9ba0f6de1a4eba232aad2f96a339f2 (diff) | |
download | Qt-3475168550c1a804f04f2a4edfeb30c04cd36551.zip Qt-3475168550c1a804f04f2a4edfeb30c04cd36551.tar.gz Qt-3475168550c1a804f04f2a4edfeb30c04cd36551.tar.bz2 |
Reduce usage of Q_ASSERT in autotests.
Using Q_ASSERT does nothing in release-mode builds, and in debug builds
it causes tests to terminate prematurely. It is much better to use
QVERIFY or QCOMPARE.
Task-number: QTBUG-17582
Reviewed-by: Rohan McGovern
Diffstat (limited to 'tests/auto/qinputdialog')
-rw-r--r-- | tests/auto/qinputdialog/tst_qinputdialog.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/auto/qinputdialog/tst_qinputdialog.cpp b/tests/auto/qinputdialog/tst_qinputdialog.cpp index 1d13eb6..e0317df 100644 --- a/tests/auto/qinputdialog/tst_qinputdialog.cpp +++ b/tests/auto/qinputdialog/tst_qinputdialog.cpp @@ -193,12 +193,12 @@ void testGetNumeric(QInputDialog *dialog, SpinBoxType * = 0, ValueType * = 0) void testGetText(QInputDialog *dialog) { QLineEdit *ledit = qFindChild<QLineEdit *>(dialog); - Q_ASSERT(ledit); + QVERIFY(ledit); QDialogButtonBox *bbox = qFindChild<QDialogButtonBox *>(dialog); - Q_ASSERT(bbox); + QVERIFY(bbox); QPushButton *okButton = bbox->button(QDialogButtonBox::Ok); - Q_ASSERT(okButton); + QVERIFY(okButton); QVERIFY(ledit->hasAcceptableInput()); QCOMPARE(ledit->selectedText(), ledit->text()); @@ -211,12 +211,12 @@ void testGetText(QInputDialog *dialog) void testGetItem(QInputDialog *dialog) { QComboBox *cbox = qFindChild<QComboBox *>(dialog); - Q_ASSERT(cbox); + QVERIFY(cbox); QDialogButtonBox *bbox = qFindChild<QDialogButtonBox *>(dialog); - Q_ASSERT(bbox); + QVERIFY(bbox); QPushButton *okButton = bbox->button(QDialogButtonBox::Ok); - Q_ASSERT(okButton); + QVERIFY(okButton); QVERIFY(okButton->isEnabled()); const int origIndex = cbox->currentIndex(); @@ -249,7 +249,7 @@ void tst_QInputDialog::timerEvent(QTimerEvent *event) { killTimer(event->timerId()); QInputDialog *dialog = qFindChild<QInputDialog *>(parent); - Q_ASSERT(dialog); + QVERIFY(dialog); if (testFunc) testFunc(dialog); dialog->done(doneCode); // cause static function call to return @@ -270,7 +270,7 @@ void tst_QInputDialog::getInteger() { QFETCH(int, min); QFETCH(int, max); - Q_ASSERT(min < max); + QVERIFY(min < max); parent = new QWidget; doneCode = QDialog::Accepted; testFunc = &tst_QInputDialog::testFuncGetInteger; @@ -310,7 +310,7 @@ void tst_QInputDialog::getDouble() QFETCH(double, min); QFETCH(double, max); QFETCH(int, decimals); - Q_ASSERT(min < max && decimals >= 0 && decimals <= 13); + QVERIFY(min < max && decimals >= 0 && decimals <= 13); parent = new QWidget; doneCode = QDialog::Accepted; testFunc = &tst_QInputDialog::testFuncGetDouble; |