diff options
Diffstat (limited to 'tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp')
-rw-r--r-- | tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp b/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp index 0e7355e..5d1f9d4 100644 --- a/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp +++ b/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the test suite of the Qt Toolkit. ** @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. +** contact the sales department at http://www.qtsoftware.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -145,7 +145,7 @@ void tst_QSqlTableModel::dropTestTables() << qTableName("bigtable") << qTableName("foo"); if (testWhiteSpaceNames(db.driverName())) - tableNames << qTableName("qtestw hitespace", db.driver()); + tableNames << qTableName("qtestw hitespace"); tst_Databases::safeDropTables(db, tableNames); @@ -277,7 +277,6 @@ void tst_QSqlTableModel::setRecord() QList<QSqlTableModel::EditStrategy> policies = QList<QSqlTableModel::EditStrategy>() << QSqlTableModel::OnFieldChange << QSqlTableModel::OnRowChange << QSqlTableModel::OnManualSubmit; - QString Xsuffix; foreach( QSqlTableModel::EditStrategy submitpolicy, policies) { QSqlTableModel model(0, db); @@ -296,8 +295,6 @@ void tst_QSqlTableModel::setRecord() if ((QSqlTableModel::EditStrategy)submitpolicy == QSqlTableModel::OnManualSubmit) QVERIFY(model.submitAll()); - else if ((QSqlTableModel::EditStrategy)submitpolicy == QSqlTableModel::OnRowChange && i == model.rowCount() -1) - model.submit(); else { // dataChanged() is not emitted when submitAll() is called QCOMPARE(spy.count(), 2); @@ -307,12 +304,10 @@ void tst_QSqlTableModel::setRecord() } } - Xsuffix.append('X'); - - QCOMPARE(model.data(model.index(0, 1)).toString(), QString("foo").append(Xsuffix)); - QCOMPARE(model.data(model.index(0, 2)).toString(), QString("bar").append(Xsuffix)); - QCOMPARE(model.data(model.index(1, 1)).toString(), QString("baz").append(Xsuffix)); - QCOMPARE(model.data(model.index(1, 2)).toString(), QString("joe").append(Xsuffix)); + QCOMPARE(model.data(model.index(0, 1)).toString(), QString("fooX")); + QCOMPARE(model.data(model.index(0, 2)).toString(), QString("barX")); + QCOMPARE(model.data(model.index(1, 1)).toString(), QString("bazX")); + QCOMPARE(model.data(model.index(1, 2)).toString(), QString("joeX")); } } |