diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-09-23 03:05:48 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-09-23 03:10:12 (GMT) |
commit | 4bd27d5c8c1f2dd759e20e4a6b3ac224799e2318 (patch) | |
tree | 5fabc4cc912f04516927f2b7100d7b496b378575 /tests | |
parent | b22994c3e1574716c8fc6a1da52251443d3c9cc6 (diff) | |
download | Qt-4bd27d5c8c1f2dd759e20e4a6b3ac224799e2318.zip Qt-4bd27d5c8c1f2dd759e20e4a6b3ac224799e2318.tar.gz Qt-4bd27d5c8c1f2dd759e20e4a6b3ac224799e2318.tar.bz2 |
Fix ListModel::set() so the implementation and docs are
consistent. If index == count() the item should be appended.
Also, this should happen regardless of whether the list is empty.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp index 31cb545..69df90b 100644 --- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp +++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp @@ -260,7 +260,7 @@ void tst_qdeclarativelistmodel::dynamic_data() QTest::newRow("set2") << "{append({'foo':123});set(0,{'foo':456});get(0).foo}" << 456 << ""; QTest::newRow("set3a") << "{append({'foo':123,'bar':456});set(0,{'foo':999});get(0).foo}" << 999 << ""; QTest::newRow("set3b") << "{append({'foo':123,'bar':456});set(0,{'foo':999});get(0).bar}" << 456 << ""; - QTest::newRow("set4a") << "{set(0,{'foo':456})}" << 0 << "<Unknown File>: QML ListModel: set: index 0 out of range"; + QTest::newRow("set4a") << "{set(0,{'foo':456});count}" << 1 << ""; QTest::newRow("set4c") << "{set(-1,{'foo':456})}" << 0 << "<Unknown File>: QML ListModel: set: index -1 out of range"; QTest::newRow("set5a") << "{append({'foo':123,'bar':456});set(0,123);count}" << 1 << "<Unknown File>: QML ListModel: set: value is not an object"; QTest::newRow("set5b") << "{append({'foo':123,'bar':456});set(0,[1,2,3]);count}" << 1 << "<Unknown File>: QML ListModel: set: value is not an object"; |