tst_qitemmodel: do not pass illegal indices to QAbstractItemModel APIs
That's undefined behavior, so don't test it. Change-Id: I468637ff1835f4f50859ac3d9876463221a3285a Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
parent
bd72950fbe
commit
77a7b5c916
@ -533,9 +533,6 @@ void tst_QItemModel::data()
|
||||
// A valid index should have a valid qvariant data
|
||||
QVERIFY(currentModel->index(0,0).isValid());
|
||||
|
||||
// shouldn't be able to set data on an invalid index
|
||||
QCOMPARE(currentModel->setData(QModelIndex(), "foo", Qt::DisplayRole), false);
|
||||
|
||||
// General Purpose roles
|
||||
QVariant variant = currentModel->data(currentModel->index(0,0), Qt::ToolTipRole);
|
||||
if (variant.isValid()) {
|
||||
@ -605,7 +602,6 @@ void tst_QItemModel::setData()
|
||||
QVERIFY(currentModel);
|
||||
QSignalSpy spy(currentModel, &QAbstractItemModel::dataChanged);
|
||||
QVERIFY(spy.isValid());
|
||||
QCOMPARE(currentModel->setData(QModelIndex(), QVariant()), false);
|
||||
QCOMPARE(spy.count(), 0);
|
||||
|
||||
QFETCH(bool, isEmpty);
|
||||
|
Loading…
Reference in New Issue
Block a user