aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2011-09-30 17:52:27 +1000
committerQt by Nokia <qt-info@nokia.com>2011-10-04 05:16:43 +0200
commit01a60f8771ba273d164042710364b7fd88168dcc (patch)
tree03e23d16d358301c215e194b378dccdd98b2530f /tests
parent8662e071c22c2be2fdf15148b375eb3f6057aab7 (diff)
Fix incorrect index when accumulating multiple removes.
Don't remove the intersecting count from the current remove twice, and accumulate consecutive not just overlapping removes. Change-Id: I426d764d980ee17ad114aa03ca4089da89c6aed2 Reviewed-on: http://codereview.qt-project.org/5902 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/declarative.pro1
-rw-r--r--tests/auto/declarative/qdeclarativechangeset/tst_qdeclarativechangeset.cpp22
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro
index d8567db8bb..60eb2a9fa0 100644
--- a/tests/auto/declarative/declarative.pro
+++ b/tests/auto/declarative/declarative.pro
@@ -31,6 +31,7 @@ PRIVATETESTS += \
qdeclarativeapplication \
qdeclarativebehaviors \
qdeclarativebinding \
+ qdeclarativechangeset \
qdeclarativeconnection \
qdeclarativeenginedebug \
qdeclarativedebugclient \
diff --git a/tests/auto/declarative/qdeclarativechangeset/tst_qdeclarativechangeset.cpp b/tests/auto/declarative/qdeclarativechangeset/tst_qdeclarativechangeset.cpp
index 6b3fcf90bf..8da3d9b814 100644
--- a/tests/auto/declarative/qdeclarativechangeset/tst_qdeclarativechangeset.cpp
+++ b/tests/auto/declarative/qdeclarativechangeset/tst_qdeclarativechangeset.cpp
@@ -727,6 +727,28 @@ void tst_qdeclarativemodelchange::sequence_data()
QTest::newRow("m(12-23,6),r(20,4)")
<< (SignalList() << Move(12,23,6) << Remove(20,4))
<< (SignalList() << Remove(12,1) << Remove(12,5,0) << Remove(20,3) << Insert(20,5,0));
+
+
+ // Complex
+ QTest::newRow("r(15,1),r(22,1)")
+ << (SignalList() << Remove(15,1) << Remove(22,1))
+ << (SignalList() << Remove(15,1) << Remove(22,1));
+ QTest::newRow("r(15,1),r(22,1),r(25,1)")
+ << (SignalList() << Remove(15,1) << Remove(22,1) << Remove(25,1))
+ << (SignalList() << Remove(15,1) << Remove(22,1) << Remove(25,1));
+ QTest::newRow("r(15,1),r(22,1),r(25,1),r(15,1)")
+ << (SignalList() << Remove(15,1) << Remove(22,1) << Remove(25,1) << Remove(15,1))
+ << (SignalList() << Remove(15,2) << Remove(21,1) << Remove(24,1));
+ QTest::newRow("r(15,1),r(22,1),r(25,1),r(15,1),r(13,1)")
+ << (SignalList() << Remove(15,1) << Remove(22,1) << Remove(25,1) << Remove(15,1) << Remove(13,1))
+ << (SignalList() << Remove(13,1) << Remove(14,2) << Remove(20,1) << Remove(23,1));
+ QTest::newRow("r(15,1),r(22,1),r(25,1),r(15,1),r(13,1),r(13,1)")
+ << (SignalList() << Remove(15,1) << Remove(22,1) << Remove(25,1) << Remove(15,1) << Remove(13,1) << Remove(13,1))
+ << (SignalList() << Remove(13,4) << Remove(19,1) << Remove(22,1));
+ QTest::newRow("r(15,1),r(22,1),r(25,1),r(15,1),r(13,1),r(13,1),m(12,13,1)")
+ << (SignalList() << Remove(15,1) << Remove(22,1) << Remove(25,1) << Remove(15,1) << Remove(13,1) << Remove(13,1) << Move(12,13,1))
+ << (SignalList() << Remove(12,1,0) << Remove(12,4) << Remove(18,1) << Remove(21,1) << Insert(13,1,0));
+
}
void tst_qdeclarativemodelchange::sequence()