diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-02-18 09:43:01 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-02-18 09:43:01 (GMT) |
commit | 177131d06d0d7a39d5de210ac8ed5dff9ca4999f (patch) | |
tree | 37c1df4b1236447c5960d3d21bbdafdf1bdaec2f /tests/auto/qsqltablemodel | |
parent | 36c81f4972b5cfbac825d18e99d9a28dd82542d8 (diff) | |
parent | db9925a187a9ad395ba2cabf23487b9a0e09c67c (diff) | |
download | Qt-177131d06d0d7a39d5de210ac8ed5dff9ca4999f.zip Qt-177131d06d0d7a39d5de210ac8ed5dff9ca4999f.tar.gz Qt-177131d06d0d7a39d5de210ac8ed5dff9ca4999f.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
Added test case for corrupt pixel count in XPM image.
QImage crash when invalid XPM is read.
Fix an issue with removing rows in a table model.
Diffstat (limited to 'tests/auto/qsqltablemodel')
-rw-r--r-- | tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp b/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp index f7d2180..bf68375 100644 --- a/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp +++ b/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp @@ -773,6 +773,27 @@ void tst_QSqlTableModel::removeInsertedRow() QCOMPARE(model.data(model.index(0, 1)).toString(), QString("harry")); QCOMPARE(model.data(model.index(1, 1)).toString(), QString("trond")); QCOMPARE(model.data(model.index(2, 1)).toString(), QString("vohi")); + + // Now insert a row with a null, and check that removing it also works (QTBUG-15979 etc) + model.insertRow(1); + model.setData(model.index(1,0), 55); + model.setData(model.index(1,1), QString("null columns")); + model.setData(model.index(1,2), QVariant()); + + model.submitAll(); + + QCOMPARE(model.rowCount(), 4); + QCOMPARE(model.data(model.index(3, 0)).toInt(), 55); + QCOMPARE(model.data(model.index(3, 1)).toString(), QString("null columns")); + QCOMPARE(model.data(model.index(3, 2)).isNull(), true); + + QVERIFY(model.removeRow(3)); + model.submitAll(); + QCOMPARE(model.rowCount(), 3); + + QCOMPARE(model.data(model.index(0, 1)).toString(), QString("harry")); + QCOMPARE(model.data(model.index(1, 1)).toString(), QString("trond")); + QCOMPARE(model.data(model.index(2, 1)).toString(), QString("vohi")); } void tst_QSqlTableModel::removeInsertedRows() |