summaryrefslogtreecommitdiffstats
path: root/tests/auto/qcompleter
diff options
context:
space:
mode:
authorJyri Tahtela <jyri.tahtela@nokia.com>2011-05-18 10:41:09 +0300
committerJyri Tahtela <jyri.tahtela@nokia.com>2011-05-18 10:41:09 +0300
commit9cacde74f7de702689725882633073e60c0a2baa (patch)
tree330d22dadbd28b14a7d8896823d1c33597e9993e /tests/auto/qcompleter
parent006c8e22075112eff6230d8168d716e44a9e29d5 (diff)
parent2c07b5d2cba8d8e499bd0861eefef12d4e00d99a (diff)
Merge remote-tracking branch 'qt/4.8'
Conflicts: doc/src/examples/wheel.qdoc src/gui/util/qflickgesture.cpp src/gui/util/qflickgesture_p.h src/gui/util/qscroller.cpp src/gui/util/qscroller.h src/gui/util/qscroller_p.h src/gui/util/qscrollerproperties.cpp src/gui/util/qscrollerproperties.h tests/auto/qscroller/tst_qscroller.cpp
Diffstat (limited to 'tests/auto/qcompleter')
-rw-r--r--tests/auto/qcompleter/tst_qcompleter.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/auto/qcompleter/tst_qcompleter.cpp b/tests/auto/qcompleter/tst_qcompleter.cpp
index 7c4fa9be2e..c1467c6c5b 100644
--- a/tests/auto/qcompleter/tst_qcompleter.cpp
+++ b/tests/auto/qcompleter/tst_qcompleter.cpp
@@ -277,7 +277,9 @@ retry:
case 'L': row = completer->completionCount() - 1; break;
case 'F': row = 0; break;
default:
- Q_ASSERT(false);
+ QFAIL(qPrintable(QString(
+ "Problem with 'step' value in test data: %1 (only P, N, L and F are allowed)."
+ ).arg(step[i])));
}
completer->setCurrentRow(row);
}
@@ -1248,9 +1250,7 @@ public:
void tst_QCompleter::task189564_omitNonSelectableItems()
{
const QString prefix("a");
- Q_ASSERT(!prefix.isEmpty());
const int n = 5;
- Q_ASSERT(n > 0);
QStringList strings;
for (int i = 0; i < n; ++i)
@@ -1278,10 +1278,11 @@ public:
{
setEditable(true);
setInsertPolicy(NoInsert);
- Q_ASSERT(completer());
- completer()->setCompletionMode(QCompleter::PopupCompletion);
- completer()->setCompletionRole(Qt::DisplayRole);
- connect(lineEdit(), SIGNAL(editingFinished()), SLOT(setCompletionPrefix()));
+ if (completer()) {
+ completer()->setCompletionMode(QCompleter::PopupCompletion);
+ completer()->setCompletionRole(Qt::DisplayRole);
+ connect(lineEdit(), SIGNAL(editingFinished()), SLOT(setCompletionPrefix()));
+ }
}
private slots:
void setCompletionPrefix() { completer()->setCompletionPrefix(lineEdit()->text()); }
@@ -1290,6 +1291,7 @@ private slots:
void tst_QCompleter::task246056_setCompletionPrefix()
{
task246056_ComboBox *comboBox = new task246056_ComboBox;
+ QVERIFY(comboBox->completer());
comboBox->addItem("");
comboBox->addItem("a1");
comboBox->addItem("a2");