| 1 | /**************************************************************************** |
| 2 | ** |
| 3 | ** Copyright (C) 2016 The Qt Company Ltd. |
| 4 | ** Contact: https://www.qt.io/licensing/ |
| 5 | ** |
| 6 | ** This file is part of the test suite of the Qt Toolkit. |
| 7 | ** |
| 8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ |
| 9 | ** Commercial License Usage |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in |
| 11 | ** accordance with the commercial license agreement provided with the |
| 12 | ** Software or, alternatively, in accordance with the terms contained in |
| 13 | ** a written agreement between you and The Qt Company. For licensing terms |
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
| 15 | ** information use the contact form at https://www.qt.io/contact-us. |
| 16 | ** |
| 17 | ** GNU General Public License Usage |
| 18 | ** Alternatively, this file may be used under the terms of the GNU |
| 19 | ** General Public License version 3 as published by the Free Software |
| 20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT |
| 21 | ** included in the packaging of this file. Please review the following |
| 22 | ** information to ensure the GNU General Public License requirements will |
| 23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. |
| 24 | ** |
| 25 | ** $QT_END_LICENSE$ |
| 26 | ** |
| 27 | ****************************************************************************/ |
| 28 | #include <qtest.h> |
| 29 | #include <qrandom.h> |
| 30 | #include <private/qqmlchangeset_p.h> |
| 31 | |
| 32 | class tst_qqmlchangeset : public QObject |
| 33 | { |
| 34 | Q_OBJECT |
| 35 | private slots: |
| 36 | void sequence_data(); |
| 37 | void sequence(); |
| 38 | |
| 39 | void apply_data(); |
| 40 | void apply(); |
| 41 | |
| 42 | void removeConsecutive_data(); |
| 43 | void removeConsecutive(); |
| 44 | void insertConsecutive_data(); |
| 45 | void insertConsecutive(); |
| 46 | |
| 47 | void copy(); |
| 48 | void debug(); |
| 49 | |
| 50 | // These create random sequences and verify a list with the reordered changes applied is the |
| 51 | // same as one with the unordered changes applied. |
| 52 | private: |
| 53 | void random_data(); |
| 54 | void random(); |
| 55 | |
| 56 | public: |
| 57 | enum { |
| 58 | MoveOp = 0, |
| 59 | InsertOp = -1, |
| 60 | RemoveOp = -2 |
| 61 | }; |
| 62 | |
| 63 | struct Signal |
| 64 | { |
| 65 | int index; |
| 66 | int count; |
| 67 | int to; |
| 68 | int moveId; |
| 69 | int offset; |
| 70 | |
| 71 | bool isInsert() const { return to == -1; } |
| 72 | bool isRemove() const { return to == -2; } |
| 73 | bool isChange() const { return to == -3; } |
| 74 | bool isMove() const { return to >= 0; } |
| 75 | }; |
| 76 | |
| 77 | static Signal Insert(int index, int count) { |
| 78 | Signal signal = { .index: index, .count: count, .to: -1, .moveId: -1, .offset: 0 }; return signal; } |
| 79 | static Signal Insert(int index, int count, int moveId, int moveOffset) { |
| 80 | Signal signal = { .index: index, .count: count, .to: -1, .moveId: moveId, .offset: moveOffset }; return signal; } |
| 81 | static Signal Remove(int index, int count) { |
| 82 | Signal signal = { .index: index, .count: count, .to: -2, .moveId: -1, .offset: 0 }; return signal; } |
| 83 | static Signal Remove(int index, int count, int moveId, int moveOffset) { |
| 84 | Signal signal = { .index: index, .count: count, .to: -2, .moveId: moveId, .offset: moveOffset }; return signal; } |
| 85 | static Signal Move(int from, int to, int count, int moveId) { |
| 86 | Signal signal = { .index: from, .count: count, .to: to, .moveId: moveId, .offset: 0 }; return signal; } |
| 87 | static Signal Change(int index, int count) { |
| 88 | Signal signal = { .index: index, .count: count, .to: -3, .moveId: -1, .offset: 0 }; return signal; } |
| 89 | |
| 90 | typedef QVector<Signal> SignalList; |
| 91 | typedef QVector<SignalList> SignalListList; |
| 92 | |
| 93 | template<typename T> |
| 94 | void move(int from, int to, int n, T *items) |
| 95 | { |
| 96 | if (from > to) { |
| 97 | // Only move forwards - flip if backwards moving |
| 98 | int tfrom = from; |
| 99 | int tto = to; |
| 100 | from = tto; |
| 101 | to = tto+n; |
| 102 | n = tfrom-tto; |
| 103 | } |
| 104 | |
| 105 | T replaced; |
| 106 | int i=0; |
| 107 | typename T::ConstIterator it=items->begin(); it += from+n; |
| 108 | for (; i<to-from; ++i,++it) |
| 109 | replaced.append(*it); |
| 110 | i=0; |
| 111 | it=items->begin(); it += from; |
| 112 | for (; i<n; ++i,++it) |
| 113 | replaced.append(*it); |
| 114 | typename T::ConstIterator f=replaced.begin(); |
| 115 | typename T::Iterator t=items->begin(); t += from; |
| 116 | for (; f != replaced.end(); ++f, ++t) |
| 117 | *t = *f; |
| 118 | } |
| 119 | |
| 120 | bool applyChanges(QVector<int> &list, const QVector<QVector<Signal> > &changes) |
| 121 | { |
| 122 | foreach (const SignalList &sl, changes) { |
| 123 | if (!applyChanges(list, changes: sl)) |
| 124 | return false; |
| 125 | } |
| 126 | return true; |
| 127 | } |
| 128 | |
| 129 | bool applyChanges(QVector<int> &list, const QVector<Signal> &changes) |
| 130 | { |
| 131 | QHash<QQmlChangeSet::MoveKey, int> removedValues; |
| 132 | foreach (const Signal &signal, changes) { |
| 133 | if (signal.isInsert()) { |
| 134 | if (signal.index < 0 || signal.index > list.count()) { |
| 135 | qDebug() << "insert out of range" << signal.index << list.count(); |
| 136 | return false; |
| 137 | } |
| 138 | if (signal.moveId != -1) { |
| 139 | QQmlChangeSet::Change insert(signal.index, signal.count, signal.moveId, signal.offset); |
| 140 | for (int i = insert.start(); i < insert.end(); ++i) |
| 141 | list.insert(i, t: removedValues.take(akey: insert.moveKey(index: i))); |
| 142 | } else { |
| 143 | list.insert(i: signal.index, n: signal.count, t: 100); |
| 144 | } |
| 145 | } else if (signal.isRemove()) { |
| 146 | if (signal.index < 0 || signal.index + signal.count > list.count()) { |
| 147 | qDebug() << "remove out of range" << signal.index << signal.count << list.count(); |
| 148 | return false; |
| 149 | } |
| 150 | if (signal.moveId != -1) { |
| 151 | QQmlChangeSet::Change remove(signal.index, signal.count, signal.moveId, signal.offset); |
| 152 | for (int i = remove.start(); i < remove.end(); ++i) |
| 153 | removedValues.insert(akey: remove.moveKey(index: i), avalue: list.at(i)); |
| 154 | } |
| 155 | list.erase(abegin: list.begin() + signal.index, aend: list.begin() + signal.index + signal.count); |
| 156 | } else if (signal.isMove()) { |
| 157 | if (signal.index < 0 |
| 158 | || signal.to < 0 |
| 159 | || signal.index + signal.count > list.count() |
| 160 | || signal.to + signal.count > list.count()) { |
| 161 | qDebug() << "move out of range" << signal.index << signal.to << signal.count << list.count(); |
| 162 | return false; |
| 163 | } |
| 164 | move(from: signal.index, to: signal.to, n: signal.count, items: &list); |
| 165 | } else if (signal.isChange()) { |
| 166 | for (int i = signal.index; i < signal.index + signal.count; ++i) |
| 167 | list[i] = 100; |
| 168 | } |
| 169 | } |
| 170 | return true; |
| 171 | } |
| 172 | |
| 173 | }; |
| 174 | |
| 175 | bool operator ==(const tst_qqmlchangeset::Signal &left, const tst_qqmlchangeset::Signal &right) |
| 176 | { |
| 177 | return left.index == right.index |
| 178 | && left.count == right.count |
| 179 | && left.to == right.to |
| 180 | && left.moveId == right.moveId |
| 181 | && (left.moveId == -1 || left.offset == right.offset); |
| 182 | } |
| 183 | |
| 184 | QT_BEGIN_NAMESPACE |
| 185 | bool operator ==(const QQmlChangeSet::Change &left, const QQmlChangeSet::Change &right) |
| 186 | { |
| 187 | return left.index == right.index && left.count == right.count && left.moveId == right.moveId; |
| 188 | } |
| 189 | QT_END_NAMESPACE |
| 190 | |
| 191 | QDebug operator <<(QDebug debug, const tst_qqmlchangeset::Signal &signal) |
| 192 | { |
| 193 | if (signal.isInsert() && signal.moveId == -1) |
| 194 | debug.nospace() << "Insert(" << signal.index << "," << signal.count << ")" ; |
| 195 | else if (signal.isInsert()) |
| 196 | debug.nospace() << "Insert(" << signal.index << "," << signal.count << "," << signal.moveId << "," << signal.offset << ")" ; |
| 197 | else if (signal.isRemove() && signal.moveId == -1) |
| 198 | debug.nospace() << "Remove(" << signal.index << "," << signal.count << ")" ; |
| 199 | else if (signal.isRemove()) |
| 200 | debug.nospace() << "Remove(" << signal.index << "," << signal.count << "," << signal.moveId << "," << signal.offset << ")" ; |
| 201 | else if (signal.isMove()) |
| 202 | debug.nospace() << "Move(" << signal.index << "," << signal.to << "," << signal.count << "," << signal.moveId << ")" ; |
| 203 | else if (signal.isChange()) |
| 204 | debug.nospace() << "Change(" << signal.index << "," << signal.count << ")" ; |
| 205 | return debug; |
| 206 | } |
| 207 | |
| 208 | Q_DECLARE_METATYPE(tst_qqmlchangeset::SignalList) |
| 209 | Q_DECLARE_METATYPE(tst_qqmlchangeset::SignalListList) |
| 210 | |
| 211 | #if 0 |
| 212 | # define VERIFY_EXPECTED_OUTPUT \ |
| 213 | QVector<int> inputList; \ |
| 214 | for (int i = 0; i < 40; ++i) \ |
| 215 | inputList.append(i); \ |
| 216 | QVector<int> outputList = inputList; \ |
| 217 | if (!applyChanges(inputList, input)) { \ |
| 218 | qDebug() << input; \ |
| 219 | qDebug() << output; \ |
| 220 | qDebug() << changes; \ |
| 221 | QVERIFY(false); \ |
| 222 | } else if (!applyChanges(outputList, output)) { \ |
| 223 | qDebug() << input; \ |
| 224 | qDebug() << output; \ |
| 225 | qDebug() << changes; \ |
| 226 | QVERIFY(false); \ |
| 227 | } else if (outputList != inputList /* || changes != output*/) { \ |
| 228 | qDebug() << input; \ |
| 229 | qDebug() << output; \ |
| 230 | qDebug() << changes; \ |
| 231 | qDebug() << inputList; \ |
| 232 | qDebug() << outputList; \ |
| 233 | QVERIFY(false); \ |
| 234 | } else if (changes != output) { \ |
| 235 | qDebug() << output; \ |
| 236 | qDebug() << changes; \ |
| 237 | QCOMPARE(outputList, inputList); \ |
| 238 | } |
| 239 | #else |
| 240 | # define VERIFY_EXPECTED_OUTPUT \ |
| 241 | if (changes != output) { \ |
| 242 | qDebug() << output; \ |
| 243 | qDebug() << changes; \ |
| 244 | } |
| 245 | #endif |
| 246 | |
| 247 | void tst_qqmlchangeset::sequence_data() |
| 248 | { |
| 249 | QTest::addColumn<SignalList>(name: "input" ); |
| 250 | QTest::addColumn<SignalList>(name: "output" ); |
| 251 | |
| 252 | // Insert |
| 253 | QTest::newRow(dataTag: "i(12,5)" ) |
| 254 | << (SignalList() << Insert(index: 12,count: 5)) |
| 255 | << (SignalList() << Insert(index: 12,count: 5)); |
| 256 | QTest::newRow(dataTag: "i(2,3),i(12,5)" ) |
| 257 | << (SignalList() << Insert(index: 2,count: 3) << Insert(index: 12,count: 5)) |
| 258 | << (SignalList() << Insert(index: 2,count: 3) << Insert(index: 12,count: 5)); |
| 259 | QTest::newRow(dataTag: "i(12,5),i(2,3)" ) |
| 260 | << (SignalList() << Insert(index: 12,count: 5) << Insert(index: 2,count: 3)) |
| 261 | << (SignalList() << Insert(index: 2,count: 3) << Insert(index: 15,count: 5)); |
| 262 | QTest::newRow(dataTag: "i(12,5),i(12,3)" ) |
| 263 | << (SignalList() << Insert(index: 12,count: 5) << Insert(index: 12,count: 3)) |
| 264 | << (SignalList() << Insert(index: 12,count: 8)); |
| 265 | QTest::newRow(dataTag: "i(12,5),i(17,3)" ) |
| 266 | << (SignalList() << Insert(index: 12,count: 5) << Insert(index: 17,count: 3)) |
| 267 | << (SignalList() << Insert(index: 12,count: 8)); |
| 268 | QTest::newRow(dataTag: "i(12,5),i(15,3)" ) |
| 269 | << (SignalList() << Insert(index: 12,count: 5) << Insert(index: 15,count: 3)) |
| 270 | << (SignalList() << Insert(index: 12,count: 8)); |
| 271 | |
| 272 | // Remove |
| 273 | QTest::newRow(dataTag: "r(3,9)" ) |
| 274 | << (SignalList() << Remove(index: 3,count: 9)) |
| 275 | << (SignalList() << Remove(index: 3,count: 9)); |
| 276 | QTest::newRow(dataTag: "r(3,4),r(3,2)" ) |
| 277 | << (SignalList() << Remove(index: 3,count: 4) << Remove(index: 3,count: 2)) |
| 278 | << (SignalList() << Remove(index: 3,count: 6)); |
| 279 | QTest::newRow(dataTag: "r(4,3),r(14,5)" ) |
| 280 | << (SignalList() << Remove(index: 4,count: 3) << Remove(index: 14,count: 5)) |
| 281 | << (SignalList() << Remove(index: 4,count: 3) << Remove(index: 14,count: 5)); |
| 282 | QTest::newRow(dataTag: "r(14,5),r(4,3)" ) |
| 283 | << (SignalList() << Remove(index: 14,count: 5) << Remove(index: 4,count: 3)) |
| 284 | << (SignalList() << Remove(index: 4,count: 3) << Remove(index: 11,count: 5)); |
| 285 | QTest::newRow(dataTag: "r(4,3),r(2,9)" ) |
| 286 | << (SignalList() << Remove(index: 4,count: 3) << Remove(index: 2,count: 9)) |
| 287 | << (SignalList() << Remove(index: 2,count: 12)); |
| 288 | |
| 289 | // Move |
| 290 | QTest::newRow(dataTag: "m(8-10,2)" ) |
| 291 | << (SignalList() << Move(from: 8,to: 10,count: 2,moveId: 0)) |
| 292 | << (SignalList() << Remove(index: 8,count: 2,moveId: 0,moveOffset: 0) << Insert(index: 10,count: 2,moveId: 0,moveOffset: 0)); |
| 293 | |
| 294 | QTest::newRow(dataTag: "m(23-12,6),m(13-15,5)" ) |
| 295 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 13,to: 15,count: 5,moveId: 1)) |
| 296 | << (SignalList() << Remove(index: 23,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 12,count: 1,moveId: 0,moveOffset: 0) << Insert(index: 15,count: 5,moveId: 0,moveOffset: 1)); |
| 297 | QTest::newRow(dataTag: "m(23-12,6),m(13-15,2)" ) |
| 298 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 13,to: 20,count: 2,moveId: 1)) |
| 299 | << (SignalList() << Remove(index: 23,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 12,count: 1,moveId: 0,moveOffset: 0) << Insert(index: 13,count: 3,moveId: 0,moveOffset: 3) << Insert(index: 20,count: 2,moveId: 0,moveOffset: 1)); |
| 300 | QTest::newRow(dataTag: "m(23-12,6),m(13-2,2)" ) |
| 301 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 13,to: 2,count: 2,moveId: 1)) |
| 302 | << (SignalList() << Remove(index: 23,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 2,count: 2,moveId: 0,moveOffset: 1) << Insert(index: 14,count: 1,moveId: 0,moveOffset: 0) << Insert(index: 15,count: 3,moveId: 0,moveOffset: 3)); |
| 303 | QTest::newRow(dataTag: "m(23-12,6),m(12-6,5)" ) |
| 304 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 12,to: 6,count: 5,moveId: 1)) |
| 305 | << (SignalList() << Remove(index: 23,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 6,count: 5,moveId: 0,moveOffset: 0) << Insert(index: 17,count: 1,moveId: 0,moveOffset: 5)); |
| 306 | QTest::newRow(dataTag: "m(23-12,6),m(10-5,4)" ) |
| 307 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 10,to: 5,count: 4,moveId: 1)) |
| 308 | << (SignalList() << Remove(index: 10,count: 2,moveId: 1,moveOffset: 0) << Remove(index: 21,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 2,moveId: 1,moveOffset: 0) << Insert(index: 7,count: 2,moveId: 0,moveOffset: 0) << Insert(index: 14,count: 4,moveId: 0,moveOffset: 2)); |
| 309 | QTest::newRow(dataTag: "m(23-12,6),m(16-5,4)" ) |
| 310 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 16,to: 5,count: 4,moveId: 1)) |
| 311 | << (SignalList() << Remove(index: 12,count: 2,moveId: 1,moveOffset: 2) << Remove(index: 21,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 2,moveId: 0,moveOffset: 4) << Insert(index: 7,count: 2,moveId: 1,moveOffset: 2) << Insert(index: 16,count: 4,moveId: 0,moveOffset: 0)); |
| 312 | QTest::newRow(dataTag: "m(23-12,6),m(13-5,4)" ) |
| 313 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 13,to: 5,count: 4,moveId: 1)) |
| 314 | << (SignalList() << Remove(index: 23,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 4,moveId: 0,moveOffset: 1) << Insert(index: 16,count: 1,moveId: 0,moveOffset: 0) << Insert(index: 17,count: 1,moveId: 0,moveOffset: 5)); |
| 315 | QTest::newRow(dataTag: "m(23-12,6),m(14-5,4)" ) |
| 316 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 14,to: 5,count: 4,moveId: 1)) |
| 317 | << (SignalList() << Remove(index: 23,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 4,moveId: 0,moveOffset: 2) << Insert(index: 16,count: 2,moveId: 0,moveOffset: 0)); |
| 318 | QTest::newRow(dataTag: "m(23-12,6),m(12-5,4)" ) |
| 319 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 12,to: 5,count: 4,moveId: 1)) |
| 320 | << (SignalList() << Remove(index: 23,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 4,moveId: 0,moveOffset: 0) << Insert(index: 16,count: 2,moveId: 0,moveOffset: 4)); |
| 321 | QTest::newRow(dataTag: "m(23-12,6),m(11-5,8)" ) |
| 322 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 11,to: 5,count: 8,moveId: 1)) |
| 323 | << (SignalList() << Remove(index: 11,count: 1,moveId: 1,moveOffset: 0) << Remove(index: 11,count: 1,moveId: 1,moveOffset: 7) << Remove(index: 21,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 1,moveId: 1,moveOffset: 0) << Insert(index: 6,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 12,count: 1,moveId: 1,moveOffset: 7)); |
| 324 | QTest::newRow(dataTag: "m(23-12,6),m(8-5,4)" ) |
| 325 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 8,to: 5,count: 4,moveId: 1)) |
| 326 | << (SignalList() << Remove(index: 8,count: 4,moveId: 1,moveOffset: 0) << Remove(index: 19,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 4,moveId: 1,moveOffset: 0) << Insert(index: 12,count: 6,moveId: 0,moveOffset: 0)); |
| 327 | QTest::newRow(dataTag: "m(23-12,6),m(2-5,4)" ) |
| 328 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 2,to: 5,count: 4,moveId: 1)) |
| 329 | << (SignalList() << Remove(index: 2,count: 4,moveId: 1,moveOffset: 0) << Remove(index: 19,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 4,moveId: 1,moveOffset: 0) << Insert(index: 12,count: 6,moveId: 0,moveOffset: 0)); |
| 330 | QTest::newRow(dataTag: "m(23-12,6),m(18-5,4)" ) |
| 331 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 18,to: 5,count: 4,moveId: 1)) |
| 332 | << (SignalList() << Remove(index: 12,count: 4,moveId: 1,moveOffset: 0) << Remove(index: 19,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 4,moveId: 1,moveOffset: 0) << Insert(index: 16,count: 6,moveId: 0,moveOffset: 0)); |
| 333 | QTest::newRow(dataTag: "m(23-12,6),m(20-5,4)" ) |
| 334 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 20,to: 5,count: 4,moveId: 1)) |
| 335 | << (SignalList() << Remove(index: 14,count: 4,moveId: 1,moveOffset: 0) << Remove(index: 19,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 4,moveId: 1,moveOffset: 0) << Insert(index: 16,count: 6,moveId: 0,moveOffset: 0)); |
| 336 | |
| 337 | QTest::newRow(dataTag: "m(23-12,6),m(5-13,11)" ) |
| 338 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 5,to: 13,count: 11,moveId: 1)) |
| 339 | << (SignalList() << Remove(index: 5,count: 7,moveId: 1,moveOffset: 0) << Remove(index: 16,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 2,moveId: 0,moveOffset: 4) << Insert(index: 13,count: 7,moveId: 1,moveOffset: 0) << Insert(index: 20,count: 4,moveId: 0,moveOffset: 0)); |
| 340 | |
| 341 | QTest::newRow(dataTag: "m(23-12,6),m(12-23,6)" ) |
| 342 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 12,to: 23,count: 6,moveId: 1)) |
| 343 | << (SignalList() << Remove(index: 23,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 23,count: 6,moveId: 0,moveOffset: 0)); // ### These cancel out. |
| 344 | QTest::newRow(dataTag: "m(23-12,6),m(10-23,4)" ) |
| 345 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 10,to: 23,count: 4,moveId: 1)) |
| 346 | << (SignalList() << Remove(index: 10,count: 2,moveId: 1,moveOffset: 0) << Remove(index: 21,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 10,count: 4,moveId: 0,moveOffset: 2) << Insert(index: 23,count: 2,moveId: 1,moveOffset: 0) << Insert(index: 25,count: 2,moveId: 0,moveOffset: 0)); |
| 347 | QTest::newRow(dataTag: "m(23-12,6),m(16-23.4)" ) |
| 348 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 16,to: 23,count: 4,moveId: 1)) |
| 349 | << (SignalList() << Remove(index: 12,count: 2,moveId: 1,moveOffset: 2) << Remove(index: 21,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 12,count: 4,moveId: 0,moveOffset: 0) << Insert(index: 23,count: 2,moveId: 0,moveOffset: 4) << Insert(index: 25,count: 2,moveId: 1,moveOffset: 2)); |
| 350 | QTest::newRow(dataTag: "m(23-12,6),m(13-23,4)" ) |
| 351 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 13,to: 23,count: 4,moveId: 1)) |
| 352 | << (SignalList() << Remove(index: 23,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 12,count: 1,moveId: 0,moveOffset: 0) << Insert(index: 13,count: 1,moveId: 0,moveOffset: 5) << Insert(index: 23,count: 4,moveId: 0,moveOffset: 1)); |
| 353 | QTest::newRow(dataTag: "m(23-12,6),m(14-23,)" ) |
| 354 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 14,to: 23,count: 4,moveId: 1)) |
| 355 | << (SignalList() << Remove(index: 23,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 12,count: 2,moveId: 0,moveOffset: 0) << Insert(index: 23,count: 4,moveId: 0,moveOffset: 2)); |
| 356 | QTest::newRow(dataTag: "m(23-12,6),m(12-23,4)" ) |
| 357 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 12,to: 23,count: 4,moveId: 1)) |
| 358 | << (SignalList() << Remove(index: 23,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 12,count: 2,moveId: 0,moveOffset: 4) << Insert(index: 23,count: 4,moveId: 0,moveOffset: 0)); |
| 359 | QTest::newRow(dataTag: "m(23-12,6),m(11-23,8)" ) |
| 360 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 11,to: 23,count: 8,moveId: 1)) |
| 361 | << (SignalList() << Remove(index: 11,count: 1,moveId: 1,moveOffset: 0) << Remove(index: 11,count: 1,moveId: 1,moveOffset: 7) << Remove(index: 21,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 23,count: 1,moveId: 1,moveOffset: 0) << Insert(index: 24,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 30,count: 1,moveId: 1,moveOffset: 7)); |
| 362 | QTest::newRow(dataTag: "m(23-12,6),m(8-23,4)" ) |
| 363 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 8,to: 23,count: 4,moveId: 1)) |
| 364 | << (SignalList() << Remove(index: 8,count: 4,moveId: 1,moveOffset: 0) << Remove(index: 19,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 8,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 23,count: 4,moveId: 1,moveOffset: 0)); |
| 365 | QTest::newRow(dataTag: "m(23-12,6),m(2-23,4)" ) |
| 366 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 2,to: 23,count: 4,moveId: 1)) |
| 367 | << (SignalList() << Remove(index: 2,count: 4,moveId: 1,moveOffset: 0) << Remove(index: 19,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 8,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 23,count: 4,moveId: 1,moveOffset: 0)); |
| 368 | QTest::newRow(dataTag: "m(23-12,6),m(18-23,4)" ) |
| 369 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 18,to: 23,count: 4,moveId: 1)) |
| 370 | << (SignalList() << Remove(index: 12,count: 4,moveId: 1,moveOffset: 0) << Remove(index: 19,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 23,count: 4,moveId: 1,moveOffset: 0)); |
| 371 | QTest::newRow(dataTag: "m(23-12,6),m(20-23,4)" ) |
| 372 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 20,to: 23,count: 4,moveId: 1)) |
| 373 | << (SignalList() << Remove(index: 14,count: 4,moveId: 1,moveOffset: 0) << Remove(index: 19,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 23,count: 4,moveId: 1,moveOffset: 0)); |
| 374 | |
| 375 | QTest::newRow(dataTag: "m(23-12,6),m(11-23,10)" ) |
| 376 | << (SignalList() << Move(from: 23,to: 12,count: 6,moveId: 0) << Move(from: 11,to: 23,count: 10,moveId: 1)) |
| 377 | << (SignalList() << Remove(index: 11,count: 1,moveId: 1,moveOffset: 0) << Remove(index: 11,count: 3,moveId: 1,moveOffset: 7) << Remove(index: 19,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 23,count: 1,moveId: 1,moveOffset: 0) << Insert(index: 24,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 30,count: 3,moveId: 1,moveOffset: 7)); |
| 378 | |
| 379 | QTest::newRow(dataTag: "m(3-9,12),m(13-5,12)" ) |
| 380 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 13,to: 15,count: 5,moveId: 1)) |
| 381 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Insert(index: 9,count: 4,moveId: 0,moveOffset: 0) << Insert(index: 13,count: 2,moveId: 0,moveOffset: 9) << Insert(index: 15,count: 5,moveId: 0,moveOffset: 4) << Insert(index: 20,count: 1,moveId: 0,moveOffset: 11)); |
| 382 | QTest::newRow(dataTag: "m(3-9,12),m(13-15,20)" ) |
| 383 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 13,to: 15,count: 20,moveId: 1)) |
| 384 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Remove(index: 9,count: 12,moveId: 1,moveOffset: 8) << Insert(index: 9,count: 4,moveId: 0,moveOffset: 0) << Insert(index: 15,count: 8,moveId: 0,moveOffset: 4) << Insert(index: 23,count: 12,moveId: 1,moveOffset: 8)); |
| 385 | QTest::newRow(dataTag: "m(3-9,12),m(13-15,2)" ) |
| 386 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 13,to: 15,count: 2,moveId: 1)) |
| 387 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Insert(index: 9,count: 4,moveId: 0,moveOffset: 0) << Insert(index: 13,count: 2,moveId: 0,moveOffset: 6) << Insert(index: 15,count: 2,moveId: 0,moveOffset: 4) << Insert(index: 17,count: 4,moveId: 0,moveOffset: 8)); |
| 388 | QTest::newRow(dataTag: "m(3-9,12),m(12-5,6)" ) |
| 389 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 12,to: 5,count: 6,moveId: 1)) |
| 390 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 6,moveId: 0,moveOffset: 3) << Insert(index: 15,count: 3,moveId: 0,moveOffset: 0) << Insert(index: 18,count: 3,moveId: 0,moveOffset: 9)); |
| 391 | QTest::newRow(dataTag: "m(3-9,12),m(10-14,5)" ) |
| 392 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 10,to: 14,count: 5,moveId: 1)) |
| 393 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Insert(index: 9,count: 1,moveId: 0,moveOffset: 0) << Insert(index: 10,count: 4,moveId: 0,moveOffset: 6) << Insert(index: 14,count: 5,moveId: 0,moveOffset: 1) << Insert(index: 19,count: 2,moveId: 0,moveOffset: 10)); |
| 394 | QTest::newRow(dataTag: "m(3-9,12),m(16-20,5)" ) |
| 395 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 16,to: 20,count: 5,moveId: 1)) |
| 396 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Insert(index: 9,count: 7,moveId: 0,moveOffset: 0) << Insert(index: 20,count: 5,moveId: 0,moveOffset: 7)); |
| 397 | QTest::newRow(dataTag: "m(3-9,12),m(13-17,5)" ) |
| 398 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 13,to: 17,count: 5,moveId: 1)) |
| 399 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Insert(index: 9,count: 4,moveId: 0,moveOffset: 0) << Insert(index: 13,count: 3,moveId: 0,moveOffset: 9) << Insert(index: 17,count: 5,moveId: 0,moveOffset: 4)); |
| 400 | QTest::newRow(dataTag: "m(3-9,12),m(14-18,5)" ) |
| 401 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 14,to: 18,count: 5,moveId: 1)) |
| 402 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Insert(index: 9,count: 5,moveId: 0,moveOffset: 0) << Insert(index: 14,count: 2,moveId: 0,moveOffset: 10) << Insert(index: 18,count: 5,moveId: 0,moveOffset: 5)); |
| 403 | QTest::newRow(dataTag: "m(3-9,12),m(12-16,5)" ) |
| 404 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 12,to: 16,count: 5,moveId: 1)) |
| 405 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Insert(index: 9,count: 3,moveId: 0,moveOffset: 0) << Insert(index: 12,count: 4,moveId: 0,moveOffset: 8) << Insert(index: 16,count: 5,moveId: 0,moveOffset: 3)); |
| 406 | QTest::newRow(dataTag: "m(3-9,12),m(11-19,5)" ) |
| 407 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 11,to: 19,count: 5,moveId: 1)) |
| 408 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Insert(index: 9,count: 2,moveId: 0,moveOffset: 0) << Insert(index: 11,count: 5,moveId: 0,moveOffset: 7) << Insert(index: 19,count: 5,moveId: 0,moveOffset: 2)); |
| 409 | QTest::newRow(dataTag: "m(3-9,12),m(8-12,5)" ) |
| 410 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 8,to: 12,count: 5,moveId: 1)) |
| 411 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Remove(index: 8,count: 1,moveId: 1,moveOffset: 0) << Insert(index: 8,count: 4,moveId: 0,moveOffset: 4) << Insert(index: 12,count: 1,moveId: 1,moveOffset: 0) << Insert(index: 13,count: 4,moveId: 0,moveOffset: 0) << Insert(index: 17,count: 4,moveId: 0,moveOffset: 8)); |
| 412 | QTest::newRow(dataTag: "m(3-9,12),m(2-6,5)" ) |
| 413 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 2,to: 6,count: 5,moveId: 1)) |
| 414 | << (SignalList() << Remove(index: 2,count: 1,moveId: 1,moveOffset: 0) << Remove(index: 2,count: 12,moveId: 0,moveOffset: 0) << Remove(index: 2,count: 4,moveId: 1,moveOffset: 1) << Insert(index: 4,count: 2,moveId: 0,moveOffset: 0) << Insert(index: 6,count: 5,moveId: 1,moveOffset: 0) << Insert(index: 11,count: 10,moveId: 0,moveOffset: 2)); |
| 415 | QTest::newRow(dataTag: "m(3-9,12),m(18-22,5)" ) |
| 416 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 18,to: 22,count: 5,moveId: 1)) |
| 417 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Remove(index: 9,count: 2,moveId: 1,moveOffset: 3) << Insert(index: 9,count: 9,moveId: 0,moveOffset: 0) << Insert(index: 22,count: 3,moveId: 0,moveOffset: 9) << Insert(index: 25,count: 2,moveId: 1,moveOffset: 3)); |
| 418 | QTest::newRow(dataTag: "m(3-9,12),m(20-24,5)" ) |
| 419 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 20,to: 24,count: 5,moveId: 1)) |
| 420 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Remove(index: 9,count: 4,moveId: 1,moveOffset: 1) << Insert(index: 9,count: 11,moveId: 0,moveOffset: 0) << Insert(index: 24,count: 1,moveId: 0,moveOffset: 11) << Insert(index: 25,count: 4,moveId: 1,moveOffset: 1)); |
| 421 | |
| 422 | QTest::newRow(dataTag: "m(3-9,12),m(5-11,8)" ) |
| 423 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 5,to: 11,count: 8,moveId: 1)) |
| 424 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Remove(index: 5,count: 4,moveId: 1,moveOffset: 0) << Insert(index: 5,count: 6,moveId: 0,moveOffset: 4) << Insert(index: 11,count: 4,moveId: 1,moveOffset: 0) << Insert(index: 15,count: 4,moveId: 0,moveOffset: 0) << Insert(index: 19,count: 2,moveId: 0,moveOffset: 10)); |
| 425 | |
| 426 | QTest::newRow(dataTag: "m(3-9,12),m(12-23,6)" ) |
| 427 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 12,to: 23,count: 6,moveId: 1)) |
| 428 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Insert(index: 9,count: 3,moveId: 0,moveOffset: 0) << Insert(index: 12,count: 3,moveId: 0,moveOffset: 9) << Insert(index: 23,count: 6,moveId: 0,moveOffset: 3)); |
| 429 | QTest::newRow(dataTag: "m(3-9,12),m(10-23,4)" ) |
| 430 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 10,to: 23,count: 4,moveId: 1)) |
| 431 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Insert(index: 9,count: 1,moveId: 0,moveOffset: 0) << Insert(index: 10,count: 7,moveId: 0,moveOffset: 5) << Insert(index: 23,count: 4,moveId: 0,moveOffset: 1)); |
| 432 | QTest::newRow(dataTag: "m(3-9,12),m(16-23,4)" ) |
| 433 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 16,to: 23,count: 4,moveId: 1)) |
| 434 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Insert(index: 9,count: 7,moveId: 0,moveOffset: 0) << Insert(index: 16,count: 1,moveId: 0,moveOffset: 11) << Insert(index: 23,count: 4,moveId: 0,moveOffset: 7)); |
| 435 | QTest::newRow(dataTag: "m(3-9,12),m(13-23,4)" ) |
| 436 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 13,to: 23,count: 4,moveId: 1)) |
| 437 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Insert(index: 9,count: 4,moveId: 0,moveOffset: 0) << Insert(index: 13,count: 4,moveId: 0,moveOffset: 8) << Insert(index: 23,count: 4,moveId: 0,moveOffset: 4)); |
| 438 | QTest::newRow(dataTag: "m(3-9,12),m(14-23,4)" ) |
| 439 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 14,to: 23,count: 4,moveId: 1)) |
| 440 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Insert(index: 9,count: 5,moveId: 0,moveOffset: 0) << Insert(index: 14,count: 3,moveId: 0,moveOffset: 9) << Insert(index: 23,count: 4,moveId: 0,moveOffset: 5)); |
| 441 | QTest::newRow(dataTag: "m(3-9,12),m(12-23,4)" ) |
| 442 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 12,to: 23,count: 4,moveId: 1)) |
| 443 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Insert(index: 9,count: 3,moveId: 0,moveOffset: 0) << Insert(index: 12,count: 5,moveId: 0,moveOffset: 7) << Insert(index: 23,count: 4,moveId: 0,moveOffset: 3)); |
| 444 | QTest::newRow(dataTag: "m(3-9,12),m(11-23,8)" ) |
| 445 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 11,to: 23,count: 8,moveId: 1)) |
| 446 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Insert(index: 9,count: 2,moveId: 0,moveOffset: 0) << Insert(index: 11,count: 2,moveId: 0,moveOffset: 10) << Insert(index: 23,count: 8,moveId: 0,moveOffset: 2)); |
| 447 | QTest::newRow(dataTag: "m(3-9,12),m(8-23,4)" ) |
| 448 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 8,to: 23,count: 4,moveId: 1)) |
| 449 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Remove(index: 8,count: 1,moveId: 1,moveOffset: 0) << Insert(index: 8,count: 9,moveId: 0,moveOffset: 3) << Insert(index: 23,count: 1,moveId: 1,moveOffset: 0) << Insert(index: 24,count: 3,moveId: 0,moveOffset: 0)); |
| 450 | QTest::newRow(dataTag: "m(3-9,12),m(2-23,4)" ) |
| 451 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 2,to: 23,count: 4,moveId: 1)) |
| 452 | << (SignalList() << Remove(index: 2,count: 1,moveId: 1,moveOffset: 0) << Remove(index: 2,count: 12,moveId: 0,moveOffset: 0) << Remove(index: 2,count: 3,moveId: 1,moveOffset: 1) << Insert(index: 5,count: 12,moveId: 0,moveOffset: 0) << Insert(index: 23,count: 4,moveId: 1,moveOffset: 0)); |
| 453 | QTest::newRow(dataTag: "m(3-9,12),m(18-23,4)" ) |
| 454 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 18,to: 23,count: 4,moveId: 1)) |
| 455 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Remove(index: 9,count: 1,moveId: 1,moveOffset: 3) << Insert(index: 9,count: 9,moveId: 0,moveOffset: 0) << Insert(index: 23,count: 3,moveId: 0,moveOffset: 9) << Insert(index: 26,count: 1,moveId: 1,moveOffset: 3)); |
| 456 | QTest::newRow(dataTag: "m(3-9,12),m(20-23,4)" ) |
| 457 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 20,to: 23,count: 4,moveId: 1)) |
| 458 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Remove(index: 9,count: 3,moveId: 1,moveOffset: 1) << Insert(index: 9,count: 11,moveId: 0,moveOffset: 0) << Insert(index: 23,count: 1,moveId: 0,moveOffset: 11) << Insert(index: 24,count: 3,moveId: 1,moveOffset: 1)); |
| 459 | |
| 460 | QTest::newRow(dataTag: "m(3-9,12),m(11-23,10)" ) |
| 461 | << (SignalList() << Move(from: 3,to: 9,count: 12,moveId: 0) << Move(from: 11,to: 23,count: 10,moveId: 1)) |
| 462 | << (SignalList() << Remove(index: 3,count: 12,moveId: 0,moveOffset: 0) << Insert(index: 9,count: 2,moveId: 0,moveOffset: 0) << Insert(index: 23,count: 10,moveId: 0,moveOffset: 2)); |
| 463 | |
| 464 | // Change |
| 465 | QTest::newRow(dataTag: "c(4,5)" ) |
| 466 | << (SignalList() << Change(index: 4,count: 5)) |
| 467 | << (SignalList() << Change(index: 4,count: 5)); |
| 468 | QTest::newRow(dataTag: "c(4,5),c(12,2)" ) |
| 469 | << (SignalList() << Change(index: 4,count: 5) << Change(index: 12,count: 2)) |
| 470 | << (SignalList() << Change(index: 4,count: 5) << Change(index: 12,count: 2)); |
| 471 | QTest::newRow(dataTag: "c(12,2),c(4,5)" ) |
| 472 | << (SignalList() << Change(index: 12,count: 2) << Change(index: 4,count: 5)) |
| 473 | << (SignalList() << Change(index: 4,count: 5) << Change(index: 12,count: 2)); |
| 474 | QTest::newRow(dataTag: "c(4,5),c(2,2)" ) |
| 475 | << (SignalList() << Change(index: 4,count: 5) << Change(index: 2,count: 2)) |
| 476 | << (SignalList() << Change(index: 2,count: 7)); |
| 477 | QTest::newRow(dataTag: "c(4,5),c(9,2)" ) |
| 478 | << (SignalList() << Change(index: 4,count: 5) << Change(index: 9,count: 2)) |
| 479 | << (SignalList() << Change(index: 4,count: 7)); |
| 480 | QTest::newRow(dataTag: "c(4,5),c(3,2)" ) |
| 481 | << (SignalList() << Change(index: 4,count: 5) << Change(index: 3,count: 2)) |
| 482 | << (SignalList() << Change(index: 3,count: 6)); |
| 483 | QTest::newRow(dataTag: "c(4,5),c(8,2)" ) |
| 484 | << (SignalList() << Change(index: 4,count: 5) << Change(index: 8,count: 2)) |
| 485 | << (SignalList() << Change(index: 4,count: 6)); |
| 486 | QTest::newRow(dataTag: "c(4,5),c(3,2)" ) |
| 487 | << (SignalList() << Change(index: 4,count: 5) << Change(index: 3,count: 2)) |
| 488 | << (SignalList() << Change(index: 3,count: 6)); |
| 489 | QTest::newRow(dataTag: "c(4,5),c(2,9)" ) |
| 490 | << (SignalList() << Change(index: 4,count: 5) << Change(index: 2,count: 9)) |
| 491 | << (SignalList() << Change(index: 2,count: 9)); |
| 492 | QTest::newRow(dataTag: "c(4,5),c(12,3),c(8,6)" ) |
| 493 | << (SignalList() << Change(index: 4,count: 5) << Change(index: 12,count: 3) << Change(index: 8,count: 6)) |
| 494 | << (SignalList() << Change(index: 4,count: 11)); |
| 495 | |
| 496 | // Insert,then remove. |
| 497 | QTest::newRow(dataTag: "i(12,6),r(12,6)" ) |
| 498 | << (SignalList() << Insert(index: 12,count: 6) << Remove(index: 12,count: 6)) |
| 499 | << (SignalList()); |
| 500 | QTest::newRow(dataTag: "i(12,6),r(10,4)" ) |
| 501 | << (SignalList() << Insert(index: 12,count: 6) << Remove(index: 10,count: 4)) |
| 502 | << (SignalList() << Remove(index: 10,count: 2) << Insert(index: 10,count: 4)); |
| 503 | QTest::newRow(dataTag: "i(12,6),r(16,4)" ) |
| 504 | << (SignalList() << Insert(index: 12,count: 6) << Remove(index: 16,count: 4)) |
| 505 | << (SignalList() << Remove(index: 12,count: 2) << Insert(index: 12,count: 4)); |
| 506 | QTest::newRow(dataTag: "i(12,6),r(13,4)" ) |
| 507 | << (SignalList() << Insert(index: 12,count: 6) << Remove(index: 13,count: 4)) |
| 508 | << (SignalList() << Insert(index: 12,count: 2)); |
| 509 | QTest::newRow(dataTag: "i(12,6),r(14,4)" ) |
| 510 | << (SignalList() << Insert(index: 12,count: 6) << Remove(index: 14,count: 4)) |
| 511 | << (SignalList() << Insert(index: 12,count: 2)); |
| 512 | QTest::newRow(dataTag: "i(12,6),r(12,4)" ) |
| 513 | << (SignalList() << Insert(index: 12,count: 6) << Remove(index: 12,count: 4)) |
| 514 | << (SignalList() << Insert(index: 12,count: 2)); |
| 515 | QTest::newRow(dataTag: "i(12,6),r(11,8)" ) |
| 516 | << (SignalList() << Insert(index: 12,count: 6) << Remove(index: 11,count: 8)) |
| 517 | << (SignalList() << Remove(index: 11,count: 2)); |
| 518 | QTest::newRow(dataTag: "i(12,6),r(8,4)" ) |
| 519 | << (SignalList() << Insert(index: 12,count: 6) << Remove(index: 8,count: 4)) |
| 520 | << (SignalList() << Remove(index: 8,count: 4) << Insert(index: 8,count: 6)); |
| 521 | QTest::newRow(dataTag: "i(12,6),r(2,4)" ) |
| 522 | << (SignalList() << Insert(index: 12,count: 6) << Remove(index: 2,count: 4)) |
| 523 | << (SignalList() << Remove(index: 2,count: 4) << Insert(index: 8,count: 6)); |
| 524 | QTest::newRow(dataTag: "i(12,6),r(18,4)" ) |
| 525 | << (SignalList() << Insert(index: 12,count: 6) << Remove(index: 18,count: 4)) |
| 526 | << (SignalList() << Remove(index: 12,count: 4) << Insert(index: 12,count: 6)); |
| 527 | QTest::newRow(dataTag: "i(12,6),r(20,4)" ) |
| 528 | << (SignalList() << Insert(index: 12,count: 6) << Remove(index: 20,count: 4)) |
| 529 | << (SignalList() << Remove(index: 14,count: 4) << Insert(index: 12,count: 6)); |
| 530 | |
| 531 | // Insert,then change |
| 532 | QTest::newRow(dataTag: "i(12,6),c(12,6)" ) |
| 533 | << (SignalList() << Insert(index: 12,count: 6) << Change(index: 12,count: 6)) |
| 534 | << (SignalList() << Insert(index: 12,count: 6)); |
| 535 | QTest::newRow(dataTag: "i(12,6),c(10,6)" ) |
| 536 | << (SignalList() << Insert(index: 12,count: 6) << Change(index: 10,count: 6)) |
| 537 | << (SignalList() << Insert(index: 12,count: 6) << Change(index: 10,count: 2)); |
| 538 | QTest::newRow(dataTag: "i(12,6),c(16,4)" ) |
| 539 | << (SignalList() << Insert(index: 12,count: 6) << Change(index: 16,count: 4)) |
| 540 | << (SignalList() << Insert(index: 12,count: 6) << Change(index: 18,count: 2)); |
| 541 | QTest::newRow(dataTag: "i(12,6),c(13,4)" ) |
| 542 | << (SignalList() << Insert(index: 12,count: 6) << Change(index: 13,count: 4)) |
| 543 | << (SignalList() << Insert(index: 12,count: 6)); |
| 544 | QTest::newRow(dataTag: "i(12,6),c(14,4)" ) |
| 545 | << (SignalList() << Insert(index: 12,count: 6) << Change(index: 14,count: 4)) |
| 546 | << (SignalList() << Insert(index: 12,count: 6)); |
| 547 | QTest::newRow(dataTag: "i(12,6),c(12,4)" ) |
| 548 | << (SignalList() << Insert(index: 12,count: 6) << Change(index: 12,count: 4)) |
| 549 | << (SignalList() << Insert(index: 12,count: 6)); |
| 550 | QTest::newRow(dataTag: "i(12,6),c(11,8)" ) |
| 551 | << (SignalList() << Insert(index: 12,count: 6) << Change(index: 11,count: 8)) |
| 552 | << (SignalList() << Insert(index: 12,count: 6) << Change(index: 11,count: 1) << Change(index: 18,count: 1)); |
| 553 | QTest::newRow(dataTag: "i(12,6),c(8,4)" ) |
| 554 | << (SignalList() << Insert(index: 12,count: 6) << Change(index: 8,count: 4)) |
| 555 | << (SignalList() << Insert(index: 12,count: 6) << Change(index: 8,count: 4)); |
| 556 | QTest::newRow(dataTag: "i(12,6),c(2,4)" ) |
| 557 | << (SignalList() << Insert(index: 12,count: 6) << Change(index: 2,count: 4)) |
| 558 | << (SignalList() << Insert(index: 12,count: 6) << Change(index: 2,count: 4)); |
| 559 | QTest::newRow(dataTag: "i(12,6),c(18,4)" ) |
| 560 | << (SignalList() << Insert(index: 12,count: 6) << Change(index: 18,count: 4)) |
| 561 | << (SignalList() << Insert(index: 12,count: 6) << Change(index: 18,count: 4)); |
| 562 | QTest::newRow(dataTag: "i(12,6),c(20,4)" ) |
| 563 | << (SignalList() << Insert(index: 12,count: 6) << Change(index: 20,count: 4)) |
| 564 | << (SignalList() << Insert(index: 12,count: 6) << Change(index: 20,count: 4)); |
| 565 | |
| 566 | // Insert,then move |
| 567 | QTest::newRow(dataTag: "i(12,6),m(12-5,6)" ) |
| 568 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 12,to: 5,count: 6,moveId: 0)) |
| 569 | << (SignalList() << Insert(index: 5,count: 6)); |
| 570 | QTest::newRow(dataTag: "i(12,6),m(10-5,4)" ) |
| 571 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 10,to: 5,count: 4,moveId: 0)) |
| 572 | << (SignalList() << Remove(index: 10,count: 2,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 2,moveId: 0,moveOffset: 0) << Insert(index: 7,count: 2) << Insert(index: 14,count: 4)); |
| 573 | QTest::newRow(dataTag: "i(12,6),m(16-5,4)" ) |
| 574 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 16,to: 5,count: 4,moveId: 0)) |
| 575 | << (SignalList() << Remove(index: 12,count: 2,moveId: 0,moveOffset: 2) << Insert(index: 5,count: 2) << Insert(index: 7,count: 2,moveId: 0,moveOffset: 2) << Insert(index: 16,count: 4)); |
| 576 | QTest::newRow(dataTag: "i(12,6),m(13-5,4)" ) |
| 577 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 13,to: 5,count: 4,moveId: 0)) |
| 578 | << (SignalList() << Insert(index: 5,count: 4) << Insert(index: 16,count: 2)); |
| 579 | QTest::newRow(dataTag: "i(12,6),m(14-5,4)" ) |
| 580 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 14,to: 5,count: 4,moveId: 0)) |
| 581 | << (SignalList() << Insert(index: 5,count: 4) << Insert(index: 16,count: 2)); |
| 582 | QTest::newRow(dataTag: "i(12,6),m(12-5,4)" ) |
| 583 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 12,to: 5,count: 4,moveId: 0)) |
| 584 | << (SignalList() << Insert(index: 5,count: 4) << Insert(index: 16,count: 2)); |
| 585 | QTest::newRow(dataTag: "i(12,6),m(11-5,8)" ) |
| 586 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 11,to: 5,count: 8,moveId: 0)) |
| 587 | << (SignalList() << Remove(index: 11,count: 1,moveId: 0,moveOffset: 0) << Remove(index: 11,count: 1,moveId: 0,moveOffset: 7) << Insert(index: 5,count: 1,moveId: 0,moveOffset: 0) << Insert(index: 6,count: 6) << Insert(index: 12,count: 1,moveId: 0,moveOffset: 7)); |
| 588 | QTest::newRow(dataTag: "i(12,6),m(8-5,4)" ) |
| 589 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 8,to: 5,count: 4,moveId: 0)) |
| 590 | << (SignalList() << Remove(index: 8,count: 4,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 4,moveId: 0,moveOffset: 0) << Insert(index: 12,count: 6)); |
| 591 | QTest::newRow(dataTag: "i(12,6),m(2-5,4)" ) |
| 592 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 2,to: 5,count: 4,moveId: 0)) |
| 593 | << (SignalList() << Remove(index: 2,count: 4,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 4,moveId: 0,moveOffset: 0) << Insert(index: 12,count: 6)); |
| 594 | QTest::newRow(dataTag: "i(12,6),m(18-5,4)" ) |
| 595 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 18,to: 5,count: 4,moveId: 0)) |
| 596 | << (SignalList() << Remove(index: 12,count: 4,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 4,moveId: 0,moveOffset: 0) << Insert(index: 16,count: 6)); |
| 597 | QTest::newRow(dataTag: "i(12,6),m(20-5,4)" ) |
| 598 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 20,to: 5,count: 4,moveId: 0)) |
| 599 | << (SignalList() << Remove(index: 14,count: 4,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 4,moveId: 0,moveOffset: 0) << Insert(index: 16,count: 6)); |
| 600 | |
| 601 | QTest::newRow(dataTag: "i(12,6),m(5-13,11)" ) |
| 602 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 5,to: 11,count: 8,moveId: 0)) |
| 603 | << (SignalList() << Remove(index: 5,count: 7,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 5) << Insert(index: 11,count: 7,moveId: 0,moveOffset: 0) << Insert(index: 18,count: 1)); |
| 604 | |
| 605 | QTest::newRow(dataTag: "i(12,6),m(12-23,6)" ) |
| 606 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 12,to: 23,count: 6,moveId: 0)) |
| 607 | << (SignalList() << Insert(index: 23,count: 6)); |
| 608 | QTest::newRow(dataTag: "i(12,6),m(10-23,4)" ) |
| 609 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 10,to: 23,count: 4,moveId: 0)) |
| 610 | << (SignalList() << Remove(index: 10,count: 2,moveId: 0,moveOffset: 0) << Insert(index: 10,count: 4) << Insert(index: 23,count: 2,moveId: 0,moveOffset: 0) << Insert(index: 25,count: 2)); |
| 611 | QTest::newRow(dataTag: "i(12,6),m(16-23,4)" ) |
| 612 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 16,to: 23,count: 4,moveId: 0)) |
| 613 | << (SignalList() << Remove(index: 12,count: 2,moveId: 0,moveOffset: 2) << Insert(index: 12,count: 4) << Insert(index: 23,count: 2) << Insert(index: 25,count: 2,moveId: 0,moveOffset: 2)); |
| 614 | QTest::newRow(dataTag: "i(12,6),m(13-23,4)" ) |
| 615 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 13,to: 23,count: 4,moveId: 0)) |
| 616 | << (SignalList() << Insert(index: 12,count: 2) << Insert(index: 23,count: 4)); |
| 617 | QTest::newRow(dataTag: "i(12,6),m(14-23,4)" ) |
| 618 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 14,to: 23,count: 4,moveId: 0)) |
| 619 | << (SignalList() << Insert(index: 12,count: 2) << Insert(index: 23,count: 4)); |
| 620 | QTest::newRow(dataTag: "i(12,6),m(12-23,4)" ) |
| 621 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 12,to: 23,count: 4,moveId: 0)) |
| 622 | << (SignalList() << Insert(index: 12,count: 2) << Insert(index: 23,count: 4)); |
| 623 | QTest::newRow(dataTag: "i(12,6),m(11-23,8)" ) |
| 624 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 11,to: 23,count: 8,moveId: 0)) |
| 625 | << (SignalList() << Remove(index: 11,count: 1,moveId: 0,moveOffset: 0) << Remove(index: 11,count: 1,moveId: 0,moveOffset: 7) << Insert(index: 23,count: 1,moveId: 0,moveOffset: 0)<< Insert(index: 24,count: 6) << Insert(index: 30,count: 1,moveId: 0,moveOffset: 7)); |
| 626 | QTest::newRow(dataTag: "i(12,6),m(8-23,4)" ) |
| 627 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 8,to: 23,count: 4,moveId: 0)) |
| 628 | << (SignalList() << Remove(index: 8,count: 4,moveId: 0,moveOffset: 0) << Insert(index: 8,count: 6) << Insert(index: 23,count: 4,moveId: 0,moveOffset: 0)); |
| 629 | QTest::newRow(dataTag: "i(12,6),m(2-23,4)" ) |
| 630 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 2,to: 23,count: 4,moveId: 0)) |
| 631 | << (SignalList() << Remove(index: 2,count: 4,moveId: 0,moveOffset: 0) << Insert(index: 8,count: 6) << Insert(index: 23,count: 4,moveId: 0,moveOffset: 0)); |
| 632 | QTest::newRow(dataTag: "i(12,6),m(18-23,4)" ) |
| 633 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 18,to: 23,count: 4,moveId: 0)) |
| 634 | << (SignalList() << Remove(index: 12,count: 4,moveId: 0,moveOffset: 0) << Insert(index: 12,count: 6) << Insert(index: 23,count: 4,moveId: 0,moveOffset: 0)); |
| 635 | QTest::newRow(dataTag: "i(12,6),m(20-23,4)" ) |
| 636 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 20,to: 23,count: 4,moveId: 0)) |
| 637 | << (SignalList() << Remove(index: 14,count: 4,moveId: 0,moveOffset: 0) << Insert(index: 12,count: 6) << Insert(index: 23,count: 4,moveId: 0,moveOffset: 0)); |
| 638 | |
| 639 | QTest::newRow(dataTag: "i(12,6),m(11-23,10)" ) |
| 640 | << (SignalList() << Insert(index: 12,count: 6) << Move(from: 11,to: 23,count: 10,moveId: 0)) |
| 641 | << (SignalList() << Remove(index: 11,count: 1,moveId: 0,moveOffset: 0) << Remove(index: 11,count: 3,moveId: 0,moveOffset: 7) << Insert(index: 23,count: 1,moveId: 0,moveOffset: 0) << Insert(index: 24,count: 6) << Insert(index: 30,count: 3,moveId: 0,moveOffset: 7)); |
| 642 | |
| 643 | // Remove,then insert |
| 644 | QTest::newRow(dataTag: "r(12,6),i(12,6)" ) |
| 645 | << (SignalList() << Remove(index: 12,count: 6) << Insert(index: 12,count: 6)) |
| 646 | << (SignalList() << Remove(index: 12,count: 6) << Insert(index: 12,count: 6)); |
| 647 | QTest::newRow(dataTag: "r(12,6),i(10,4)" ) |
| 648 | << (SignalList() << Remove(index: 12,count: 6) << Insert(index: 10,count: 14)) |
| 649 | << (SignalList() << Remove(index: 12,count: 6) << Insert(index: 10,count: 14)); |
| 650 | QTest::newRow(dataTag: "r(12,6),i(16,4)" ) |
| 651 | << (SignalList() << Remove(index: 12,count: 6) << Insert(index: 16,count: 4)) |
| 652 | << (SignalList() << Remove(index: 12,count: 6) << Insert(index: 16,count: 4)); |
| 653 | QTest::newRow(dataTag: "r(12,6),i(13,4)" ) |
| 654 | << (SignalList() << Remove(index: 12,count: 6) << Insert(index: 13,count: 4)) |
| 655 | << (SignalList() << Remove(index: 12,count: 6) << Insert(index: 13,count: 4)); |
| 656 | QTest::newRow(dataTag: "r(12,6),i(14,4)" ) |
| 657 | << (SignalList() << Remove(index: 12,count: 6) << Insert(index: 14,count: 4)) |
| 658 | << (SignalList() << Remove(index: 12,count: 6) << Insert(index: 14,count: 4)); |
| 659 | QTest::newRow(dataTag: "r(12,6),i(12,4)" ) |
| 660 | << (SignalList() << Remove(index: 12,count: 6) << Insert(index: 12,count: 4)) |
| 661 | << (SignalList() << Remove(index: 12,count: 6) << Insert(index: 12,count: 4)); |
| 662 | QTest::newRow(dataTag: "r(12,6),i(11,8)" ) |
| 663 | << (SignalList() << Remove(index: 12,count: 6) << Insert(index: 11,count: 8)) |
| 664 | << (SignalList() << Remove(index: 12,count: 6) << Insert(index: 11,count: 8)); |
| 665 | QTest::newRow(dataTag: "r(12,6),i(8,4)" ) |
| 666 | << (SignalList() << Remove(index: 12,count: 6) << Insert(index: 8,count: 4)) |
| 667 | << (SignalList() << Remove(index: 12,count: 6) << Insert(index: 8,count: 4)); |
| 668 | QTest::newRow(dataTag: "r(12,6),i(2,4)" ) |
| 669 | << (SignalList() << Remove(index: 12,count: 6) << Insert(index: 2,count: 4)) |
| 670 | << (SignalList() << Remove(index: 12,count: 6) << Insert(index: 2,count: 4)); |
| 671 | QTest::newRow(dataTag: "r(12,6),i(18,4)" ) |
| 672 | << (SignalList() << Remove(index: 12,count: 6) << Insert(index: 18,count: 4)) |
| 673 | << (SignalList() << Remove(index: 12,count: 6) << Insert(index: 18,count: 4)); |
| 674 | QTest::newRow(dataTag: "r(12,6),i(20,4)" ) |
| 675 | << (SignalList() << Remove(index: 12,count: 6) << Insert(index: 20,count: 4)) |
| 676 | << (SignalList() << Remove(index: 12,count: 6) << Insert(index: 20,count: 4)); |
| 677 | |
| 678 | // Move,then insert |
| 679 | QTest::newRow(dataTag: "m(12-5,6),i(12,6)" ) |
| 680 | << (SignalList() << Move(from: 12,to: 5,count: 6,moveId: 0) << Insert(index: 12,count: 6)) |
| 681 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 12,count: 6)); |
| 682 | QTest::newRow(dataTag: "m(12-5,6),i(10,4)" ) |
| 683 | << (SignalList() << Move(from: 12,to: 5,count: 6,moveId: 0) << Insert(index: 10,count: 4)) |
| 684 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 5,moveId: 0,moveOffset: 0) << Insert(index: 10,count: 4) << Insert(index: 14,count: 1,moveId: 0,moveOffset: 5)); |
| 685 | QTest::newRow(dataTag: "m(12-5,6),i(16,4)" ) |
| 686 | << (SignalList() << Move(from: 12,to: 5,count: 6,moveId: 0) << Insert(index: 16,count: 4)) |
| 687 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 16,count: 4)); |
| 688 | QTest::newRow(dataTag: "m(12-5,6),i(13,4)" ) |
| 689 | << (SignalList() << Move(from: 12,to: 5,count: 6,moveId: 0) << Insert(index: 13,count: 4)) |
| 690 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 13,count: 4)); |
| 691 | QTest::newRow(dataTag: "m(12-5,6),i(14,4)" ) |
| 692 | << (SignalList() << Move(from: 12,to: 5,count: 6,moveId: 0) << Insert(index: 14,count: 4)) |
| 693 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 14,count: 4)); |
| 694 | QTest::newRow(dataTag: "m(12-5,6),i(12,4)" ) |
| 695 | << (SignalList() << Move(from: 12,to: 5,count: 6,moveId: 0) << Insert(index: 12,count: 4)) |
| 696 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 12,count: 4)); |
| 697 | QTest::newRow(dataTag: "m(12-5,6),i(11,8)" ) |
| 698 | << (SignalList() << Move(from: 12,to: 5,count: 6,moveId: 0) << Insert(index: 11,count: 8)) |
| 699 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 11,count: 8)); |
| 700 | QTest::newRow(dataTag: "m(12-5,6),i(8,4)" ) |
| 701 | << (SignalList() << Move(from: 12,to: 5,count: 6,moveId: 0) << Insert(index: 8,count: 4)) |
| 702 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 3,moveId: 0,moveOffset: 0) << Insert(index: 8,count: 4) << Insert(index: 12,count: 3,moveId: 0,moveOffset: 3)); |
| 703 | QTest::newRow(dataTag: "m(12-5,6),i(2,4)" ) |
| 704 | << (SignalList() << Move(from: 12,to: 5,count: 6,moveId: 0) << Insert(index: 2,count: 4)) |
| 705 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 2,count: 4) << Insert(index: 9,count: 6,moveId: 0,moveOffset: 0)); |
| 706 | QTest::newRow(dataTag: "m(12-5,6),i(18,4)" ) |
| 707 | << (SignalList() << Move(from: 12,to: 5,count: 6,moveId: 0) << Insert(index: 18,count: 4)) |
| 708 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 18,count: 4)); |
| 709 | QTest::newRow(dataTag: "m(12-5,6),i(20,4)" ) |
| 710 | << (SignalList() << Move(from: 12,to: 5,count: 6,moveId: 0) << Insert(index: 20,count: 4)) |
| 711 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 20,count: 4)); |
| 712 | |
| 713 | QTest::newRow(dataTag: "m(12-23,6),i(12,6)" ) |
| 714 | << (SignalList() << Move(from: 12,to: 23,count: 6,moveId: 0) << Insert(index: 12,count: 6)) |
| 715 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 12,count: 6) << Insert(index: 29,count: 6,moveId: 0,moveOffset: 0)); |
| 716 | QTest::newRow(dataTag: "m(12-23,6),i(10,4)" ) |
| 717 | << (SignalList() << Move(from: 12,to: 23,count: 6,moveId: 0) << Insert(index: 10,count: 4)) |
| 718 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 10,count: 4) << Insert(index: 27,count: 6,moveId: 0,moveOffset: 0)); |
| 719 | QTest::newRow(dataTag: "m(12-23,6),i(16,4)" ) |
| 720 | << (SignalList() << Move(from: 12,to: 23,count: 6,moveId: 0) << Insert(index: 16,count: 4)) |
| 721 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 16,count: 4) << Insert(index: 27,count: 6,moveId: 0,moveOffset: 0)); |
| 722 | QTest::newRow(dataTag: "m(12-23,6),i(13,4)" ) |
| 723 | << (SignalList() << Move(from: 12,to: 23,count: 6,moveId: 0) << Insert(index: 13,count: 4)) |
| 724 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 13,count: 4) << Insert(index: 27,count: 6,moveId: 0,moveOffset: 0)); |
| 725 | QTest::newRow(dataTag: "m(12-23,6),i(14,4)" ) |
| 726 | << (SignalList() << Move(from: 12,to: 23,count: 6,moveId: 0) << Insert(index: 14,count: 4)) |
| 727 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 14,count: 4) << Insert(index: 27,count: 6,moveId: 0,moveOffset: 0)); |
| 728 | QTest::newRow(dataTag: "m(12-23,6),i(12,4)" ) |
| 729 | << (SignalList() << Move(from: 12,to: 23,count: 6,moveId: 0) << Insert(index: 12,count: 4)) |
| 730 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 12,count: 4) << Insert(index: 27,count: 6,moveId: 0,moveOffset: 0)); |
| 731 | QTest::newRow(dataTag: "m(12-23,6),i(11,8)" ) |
| 732 | << (SignalList() << Move(from: 12,to: 23,count: 6,moveId: 0) << Insert(index: 11,count: 8)) |
| 733 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 11,count: 8) << Insert(index: 31,count: 6,moveId: 0,moveOffset: 0)); |
| 734 | QTest::newRow(dataTag: "m(12-23,6),i(8,4)" ) |
| 735 | << (SignalList() << Move(from: 12,to: 23,count: 6,moveId: 0) << Insert(index: 8,count: 4)) |
| 736 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 8,count: 4) << Insert(index: 27,count: 6,moveId: 0,moveOffset: 0)); |
| 737 | QTest::newRow(dataTag: "m(12-23,6),i(2,4)" ) |
| 738 | << (SignalList() << Move(from: 12,to: 23,count: 6,moveId: 0) << Insert(index: 2,count: 4)) |
| 739 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 2,count: 4) << Insert(index: 27,count: 6,moveId: 0,moveOffset: 0)); |
| 740 | QTest::newRow(dataTag: "m(12-23,6),i(18,4)" ) |
| 741 | << (SignalList() << Move(from: 12,to: 23,count: 6,moveId: 0) << Insert(index: 18,count: 4)) |
| 742 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 18,count: 4) << Insert(index: 27,count: 6,moveId: 0,moveOffset: 0)); |
| 743 | QTest::newRow(dataTag: "m(12-23,6),i(20,4)" ) |
| 744 | << (SignalList() << Move(from: 12,to: 23,count: 6,moveId: 0) << Insert(index: 20,count: 4)) |
| 745 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 20,count: 4) << Insert(index: 27,count: 6,moveId: 0,moveOffset: 0)); |
| 746 | |
| 747 | // Move,then remove |
| 748 | QTest::newRow(dataTag: "m(12-5,6),r(12,6)" ) |
| 749 | << (SignalList() << Move(from: 12,to: 5,count: 6,moveId: 0) << Remove(index: 12,count: 6)) |
| 750 | << (SignalList() << Remove(index: 6,count: 6) << Remove(index: 6,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 6,moveId: 0,moveOffset: 0)); |
| 751 | QTest::newRow(dataTag: "m(12-5,6),r(10,4)" ) |
| 752 | << (SignalList() << Move(from: 12,to: 5,count: 6,moveId: 0) << Remove(index: 10,count: 4)) // ### |
| 753 | << (SignalList() << Remove(index: 5,count: 3) << Remove(index: 9,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 5,moveId: 0,moveOffset: 0)); |
| 754 | QTest::newRow(dataTag: "m(12-5,6),r(16,4)" ) |
| 755 | << (SignalList() << Move(from: 12,to: 5,count: 6,moveId: 0) << Remove(index: 16,count: 4)) |
| 756 | << (SignalList() << Remove(index: 10,count: 2) << Remove(index: 10,count: 6,moveId: 0,moveOffset: 0) << Remove(index: 10,count: 2) << Insert(index: 5,count: 6,moveId: 0,moveOffset: 0)); |
| 757 | QTest::newRow(dataTag: "m(12-5,6),r(13,4)" ) |
| 758 | << (SignalList() << Move(from: 12,to: 5,count: 6,moveId: 0) << Remove(index: 13,count: 4)) |
| 759 | << (SignalList() << Remove(index: 7,count: 4) << Remove(index: 8,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 6,moveId: 0,moveOffset: 0)); |
| 760 | QTest::newRow(dataTag: "m(12-5,6),r(14,4)" ) |
| 761 | << (SignalList() << Move(from: 12,to: 5,count: 6,moveId: 0) << Remove(index: 14,count: 4)) |
| 762 | << (SignalList() << Remove(index: 8,count: 4) << Remove(index: 8,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 6,moveId: 0,moveOffset: 0)); |
| 763 | QTest::newRow(dataTag: "m(12-5,6),r(12,4)" ) |
| 764 | << (SignalList() << Move(from: 12,to: 5,count: 6,moveId: 0) << Remove(index: 12,count: 4)) |
| 765 | << (SignalList() << Remove(index: 6,count: 4) << Remove(index: 8,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 6,moveId: 0,moveOffset: 0)); |
| 766 | QTest::newRow(dataTag: "m(12-5,6),r(11,8)" ) |
| 767 | << (SignalList() << Move(from: 12,to: 5,count: 6,moveId: 0) << Remove(index: 11,count: 8)) |
| 768 | << (SignalList() << Remove(index: 5,count: 7) << Remove(index: 5,count: 6,moveId: 0,moveOffset: 0) << Remove(index: 5,count: 1) << Insert(index: 5,count: 6,moveId: 0,moveOffset: 0)); |
| 769 | QTest::newRow(dataTag: "m(12-5,6),r(8,4)" ) |
| 770 | << (SignalList() << Move(from: 12,to: 5,count: 6,moveId: 0) << Remove(index: 8,count: 4)) // ### |
| 771 | << (SignalList() << Remove(index: 5,count: 1) << Remove(index: 11,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 3,moveId: 0,moveOffset: 0)); |
| 772 | QTest::newRow(dataTag: "m(12-5,6),r(2,4)" ) |
| 773 | << (SignalList() << Move(from: 12,to: 5,count: 6,moveId: 0) << Remove(index: 2,count: 4)) |
| 774 | << (SignalList() << Remove(index: 2,count: 3) << Remove(index: 9,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 2,count: 5,moveId: 0,moveOffset: 1)); |
| 775 | QTest::newRow(dataTag: "m(12-5,6),r(6,4)" ) |
| 776 | << (SignalList() << Move(from: 12,to: 5,count: 6,moveId: 0) << Remove(index: 6,count: 4)) |
| 777 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 1,moveId: 0,moveOffset: 0) << Insert(index: 6,count: 1,moveId: 0,moveOffset: 5)); |
| 778 | QTest::newRow(dataTag: "m(12-5,6),r(18,4)" ) |
| 779 | << (SignalList() << Move(from: 12,to: 5,count: 6,moveId: 0) << Remove(index: 18,count: 4)) |
| 780 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Remove(index: 12,count: 4) << Insert(index: 5,count: 6,moveId: 0,moveOffset: 0)); |
| 781 | QTest::newRow(dataTag: "m(12-5,6),r(20,4)" ) |
| 782 | << (SignalList() << Move(from: 12,to: 5,count: 6,moveId: 0) << Remove(index: 20,count: 4)) |
| 783 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Remove(index: 14,count: 4) << Insert(index: 5,count: 6,moveId: 0,moveOffset: 0)); |
| 784 | |
| 785 | QTest::newRow(dataTag: "m(12-23,6),r(12,6)" ) |
| 786 | << (SignalList() << Move(from: 12,to: 23,count: 6,moveId: 0) << Remove(index: 12,count: 6)) |
| 787 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Remove(index: 12,count: 6) << Insert(index: 17,count: 6,moveId: 0,moveOffset: 0)); |
| 788 | QTest::newRow(dataTag: "m(12-23,6),r(10,4)" ) |
| 789 | << (SignalList() << Move(from: 12,to: 23,count: 6,moveId: 0) << Remove(index: 10,count: 4)) |
| 790 | << (SignalList() << Remove(index: 10,count: 2) << Remove(index: 10,count: 6,moveId: 0,moveOffset: 0) << Remove(index: 10,count: 2) << Insert(index: 19,count: 6,moveId: 0,moveOffset: 0)); |
| 791 | QTest::newRow(dataTag: "m(12-23,6),r(16,4)" ) |
| 792 | << (SignalList() << Move(from: 12,to: 23,count: 6,moveId: 0) << Remove(index: 16,count: 4)) |
| 793 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Remove(index: 16,count: 4) << Insert(index: 19,count: 6,moveId: 0,moveOffset: 0)); |
| 794 | QTest::newRow(dataTag: "m(12-23,6),r(13,4)" ) |
| 795 | << (SignalList() << Move(from: 12,to: 23,count: 6,moveId: 0) << Remove(index: 13,count: 4)) |
| 796 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Remove(index: 13,count: 4) << Insert(index: 19,count: 6,moveId: 0,moveOffset: 0)); |
| 797 | QTest::newRow(dataTag: "m(12-23,6),r(14,4)" ) |
| 798 | << (SignalList() << Move(from: 12,to: 23,count: 6,moveId: 0) << Remove(index: 14,count: 4)) |
| 799 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Remove(index: 14,count: 4) << Insert(index: 19,count: 6,moveId: 0,moveOffset: 0)); |
| 800 | QTest::newRow(dataTag: "m(12-23,6),r(12,4)" ) |
| 801 | << (SignalList() << Move(from: 12,to: 23,count: 6,moveId: 0) << Remove(index: 12,count: 4)) |
| 802 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Remove(index: 12,count: 4) << Insert(index: 19,count: 6,moveId: 0,moveOffset: 0)); |
| 803 | QTest::newRow(dataTag: "m(12-23,6),r(11,8)" ) |
| 804 | << (SignalList() << Move(from: 12,to: 23,count: 6,moveId: 0) << Remove(index: 11,count: 8)) |
| 805 | << (SignalList() << Remove(index: 11,count: 1) << Remove(index: 11,count: 6,moveId: 0,moveOffset: 0) << Remove(index: 11,count: 7) << Insert(index: 15,count: 6,moveId: 0,moveOffset: 0)); |
| 806 | QTest::newRow(dataTag: "m(12-23,6),r(8,4)" ) |
| 807 | << (SignalList() << Move(from: 12,to: 23,count: 6,moveId: 0) << Remove(index: 8,count: 4)) |
| 808 | << (SignalList() << Remove(index: 8,count: 4) << Remove(index: 8,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 19,count: 6,moveId: 0,moveOffset: 0)); |
| 809 | QTest::newRow(dataTag: "m(12-23,6),r(2,4)" ) |
| 810 | << (SignalList() << Move(from: 12,to: 23,count: 6,moveId: 0) << Remove(index: 2,count: 4)) |
| 811 | << (SignalList() << Remove(index: 2,count: 4) << Remove(index: 8,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 19,count: 6,moveId: 0,moveOffset: 0)); |
| 812 | QTest::newRow(dataTag: "m(12-23,6),r(18,4)" ) |
| 813 | << (SignalList() << Move(from: 12,to: 23,count: 6,moveId: 0) << Remove(index: 18,count: 4)) |
| 814 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Remove(index: 18,count: 4) << Insert(index: 19,count: 6,moveId: 0,moveOffset: 0)); |
| 815 | QTest::newRow(dataTag: "m(12-23,6),r(20,4)" ) |
| 816 | << (SignalList() << Move(from: 12,to: 23,count: 6,moveId: 0) << Remove(index: 20,count: 4)) |
| 817 | << (SignalList() << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Remove(index: 20,count: 3) << Insert(index: 20,count: 5,moveId: 0,moveOffset: 1)); |
| 818 | |
| 819 | |
| 820 | // Complex |
| 821 | QTest::newRow(dataTag: "r(15,1),r(22,1)" ) |
| 822 | << (SignalList() << Remove(index: 15,count: 1) << Remove(index: 22,count: 1)) |
| 823 | << (SignalList() << Remove(index: 15,count: 1) << Remove(index: 22,count: 1)); |
| 824 | QTest::newRow(dataTag: "r(15,1),r(22,1),r(25,1)" ) |
| 825 | << (SignalList() << Remove(index: 15,count: 1) << Remove(index: 22,count: 1) << Remove(index: 25,count: 1)) |
| 826 | << (SignalList() << Remove(index: 15,count: 1) << Remove(index: 22,count: 1) << Remove(index: 25,count: 1)); |
| 827 | QTest::newRow(dataTag: "r(15,1),r(22,1),r(25,1),r(15,1)" ) |
| 828 | << (SignalList() << Remove(index: 15,count: 1) << Remove(index: 22,count: 1) << Remove(index: 25,count: 1) << Remove(index: 15,count: 1)) |
| 829 | << (SignalList() << Remove(index: 15,count: 2) << Remove(index: 21,count: 1) << Remove(index: 24,count: 1)); |
| 830 | QTest::newRow(dataTag: "r(15,1),r(22,1),r(25,1),r(15,1),r(13,1)" ) |
| 831 | << (SignalList() << Remove(index: 15,count: 1) << Remove(index: 22,count: 1) << Remove(index: 25,count: 1) << Remove(index: 15,count: 1) << Remove(index: 13,count: 1)) |
| 832 | << (SignalList() << Remove(index: 13,count: 1) << Remove(index: 14,count: 2) << Remove(index: 20,count: 1) << Remove(index: 23,count: 1)); |
| 833 | QTest::newRow(dataTag: "r(15,1),r(22,1),r(25,1),r(15,1),r(13,1),r(13,1)" ) |
| 834 | << (SignalList() << Remove(index: 15,count: 1) << Remove(index: 22,count: 1) << Remove(index: 25,count: 1) << Remove(index: 15,count: 1) << Remove(index: 13,count: 1) << Remove(index: 13,count: 1)) |
| 835 | << (SignalList() << Remove(index: 13,count: 4) << Remove(index: 19,count: 1) << Remove(index: 22,count: 1)); |
| 836 | QTest::newRow(dataTag: "r(15,1),r(22,1),r(25,1),r(15,1),r(13,1),r(13,1),m(12,13,1)" ) |
| 837 | << (SignalList() << Remove(index: 15,count: 1) << Remove(index: 22,count: 1) << Remove(index: 25,count: 1) << Remove(index: 15,count: 1) << Remove(index: 13,count: 1) << Remove(index: 13,count: 1) << Move(from: 12,to: 13,count: 1,moveId: 0)) |
| 838 | << (SignalList() << Remove(index: 12,count: 1,moveId: 0,moveOffset: 0) << Remove(index: 12,count: 4) << Remove(index: 18,count: 1) << Remove(index: 21,count: 1) << Insert(index: 13,count: 1,moveId: 0,moveOffset: 0)); |
| 839 | |
| 840 | QTest::newRow(dataTag: "r(12,18),r(3,0)" ) |
| 841 | << (SignalList() << Remove(index: 12,count: 18) << Remove(index: 3,count: 0)) |
| 842 | << (SignalList() << Remove(index: 12,count: 18)); |
| 843 | QTest::newRow(dataTag: "r(12,18),r(3,0),r(1,2)" ) |
| 844 | << (SignalList() << Remove(index: 12,count: 18) << Remove(index: 3,count: 0) << Remove(index: 1,count: 2)) |
| 845 | << (SignalList() << Remove(index: 1,count: 2) << Remove(index: 10,count: 18)); |
| 846 | QTest::newRow(dataTag: "r(12,18),r(3,0),r(1,2),m(4,0,11)" ) |
| 847 | << (SignalList() << Remove(index: 12,count: 18) << Remove(index: 3,count: 0) << Remove(index: 1,count: 2) << Move(from: 4,to: 0,count: 11,moveId: 0)) |
| 848 | << (SignalList() << Remove(index: 1,count: 2) << Remove(index: 4,count: 6,moveId: 0,moveOffset: 0) << Remove(index: 4,count: 18) << Remove(index: 4,count: 5,moveId: 0,moveOffset: 6) << Insert(index: 0,count: 11,moveId: 0,moveOffset: 0)); |
| 849 | QTest::newRow(dataTag: "r(12,18),r(3,0),r(1,2),m(4,0,11),r(14,3)" ) |
| 850 | << (SignalList() << Remove(index: 12,count: 18) << Remove(index: 3,count: 0) << Remove(index: 1,count: 2) << Move(from: 4,to: 0,count: 11,moveId: 0) << Remove(index: 14,count: 3)) |
| 851 | << (SignalList() << Remove(index: 1,count: 2) << Remove(index: 3,count: 1) << Remove(index: 3,count: 6,moveId: 0,moveOffset: 0) << Remove(index: 3,count: 18) << Remove(index: 3,count: 5,moveId: 0,moveOffset: 6) << Remove(index: 3,count: 2) << Insert(index: 0,count: 11,moveId: 0,moveOffset: 0)); |
| 852 | |
| 853 | QTest::newRow(dataTag: "m(9,11,14),i(16,1)" ) |
| 854 | << (SignalList() << Move(from: 9,to: 11,count: 14,moveId: 0) << Insert(index: 16,count: 1)) |
| 855 | << (SignalList() << Remove(index: 9,count: 14,moveId: 0,moveOffset: 0) << Insert(index: 11,count: 5,moveId: 0,moveOffset: 0) << Insert(index: 16,count: 1) << Insert(index: 17,count: 9,moveId: 0,moveOffset: 5)); |
| 856 | QTest::newRow(dataTag: "m(9,11,14),i(16,1),m(22,38,3)" ) |
| 857 | << (SignalList() << Move(from: 9,to: 11,count: 14,moveId: 0) << Insert(index: 16,count: 1) << Move(from: 22,to: 38,count: 3,moveId: 1)) |
| 858 | << (SignalList() << Remove(index: 9,count: 14,moveId: 0,moveOffset: 0) << Insert(index: 11,count: 5,moveId: 0,moveOffset: 0) << Insert(index: 16,count: 1) << Insert(index: 17,count: 5,moveId: 0,moveOffset: 5) << Insert(index: 22,count: 1,moveId: 0,moveOffset: 13) << Insert(index: 38,count: 3,moveId: 0,moveOffset: 10)); |
| 859 | |
| 860 | QTest::newRow(dataTag: "i(28,2),m(7,5,22)" ) |
| 861 | << (SignalList() << Insert(index: 28,count: 2) << Move(from: 7,to: 5,count: 22,moveId: 0)) |
| 862 | << (SignalList() << Remove(index: 7,count: 21,moveId: 0,moveOffset: 0) << Insert(index: 5,count: 21,moveId: 0,moveOffset: 0) << Insert(index: 26,count: 1) << Insert(index: 29,count: 1)); |
| 863 | |
| 864 | QTest::newRow(dataTag: "i(16,3),m(18,28,15)" ) |
| 865 | << (SignalList() << Insert(index: 16,count: 3) << Move(from: 18,to: 28,count: 15,moveId: 0)) |
| 866 | << (SignalList() << Remove(index: 16,count: 14,moveId: 0,moveOffset: 1) << Insert(index: 16,count: 2) << Insert(index: 28,count: 1) << Insert(index: 29,count: 14,moveId: 0,moveOffset: 1)); |
| 867 | |
| 868 | QTest::newRow(dataTag: "m(33,12,6),m(18,20,20)" ) |
| 869 | << (SignalList() << Move(from: 22,to: 12,count: 6,moveId: 0) << Move(from: 18,to: 20,count: 20,moveId: 1)) |
| 870 | << (SignalList() << Remove(index: 12,count: 10,moveId: 1,moveOffset: 0) << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Remove(index: 12,count: 10,moveId: 1,moveOffset: 10) |
| 871 | << Insert(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 20,count: 20,moveId: 1,moveOffset: 0)); |
| 872 | QTest::newRow(dataTag: "m(33,12,6),m(18,20,20),m(38,19,1)" ) |
| 873 | << (SignalList() << Move(from: 22,to: 12,count: 6,moveId: 0) << Move(from: 18,to: 20,count: 20,moveId: 1) << Move(from: 28,to: 19,count: 1,moveId: 2)) |
| 874 | << (SignalList() << Remove(index: 12,count: 10,moveId: 1,moveOffset: 0) << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Remove(index: 12,count: 10,moveId: 1,moveOffset: 10) |
| 875 | << Insert(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 19,count: 1,moveId: 1,moveOffset: 8) << Insert(index: 21,count: 8,moveId: 1,moveOffset: 0) << Insert(index: 29,count: 11,moveId: 1,moveOffset: 9)); |
| 876 | QTest::newRow(dataTag: "m(33,12,6),m(18,20,20),m(38,19,1),r(34,4)" ) |
| 877 | << (SignalList() << Move(from: 22,to: 12,count: 6,moveId: 0) << Move(from: 18,to: 20,count: 20,moveId: 1) << Move(from: 28,to: 19,count: 1,moveId: 2) << Remove(index: 34,count: 4)) |
| 878 | << (SignalList() << Remove(index: 12,count: 10,moveId: 1,moveOffset: 0) << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Remove(index: 12,count: 10,moveId: 1,moveOffset: 10) |
| 879 | << Insert(index: 12,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 19,count: 1,moveId: 1,moveOffset: 8) << Insert(index: 21,count: 8,moveId: 1,moveOffset: 0) << Insert(index: 29,count: 5,moveId: 1,moveOffset: 9) << Insert(index: 34,count: 2,moveId: 1,moveOffset: 18)); |
| 880 | QTest::newRow(dataTag: "m(33,12,6),m(18,20,20),m(38,19,1),r(34,4),m(13,9,15)" ) |
| 881 | << (SignalList() << Move(from: 22,to: 12,count: 6,moveId: 0) << Move(from: 18,to: 20,count: 20,moveId: 1) << Move(from: 28,to: 19,count: 1,moveId: 2) << Remove(index: 34,count: 4) << Move(from: 13,to: 9,count: 15,moveId: 3)) |
| 882 | << (SignalList() << Remove(index: 12,count: 10,moveId: 1,moveOffset: 0) << Remove(index: 12,count: 6,moveId: 0,moveOffset: 0) << Remove(index: 12,count: 10,moveId: 1,moveOffset: 10) << Remove(index: 12,count: 1,moveId: 3,moveOffset: 5) << Remove(index: 12,count: 1,moveId: 3,moveOffset: 7) |
| 883 | << Insert(index: 9,count: 5,moveId: 0,moveOffset: 1) << Insert(index: 14,count: 1,moveId: 3,moveOffset: 5) << Insert(index: 15,count: 1,moveId: 1,moveOffset: 8) << Insert(index: 16,count: 1,moveId: 3,moveOffset: 7) << Insert(index: 17,count: 7,moveId: 1,moveOffset: 0) << Insert(index: 27,count: 1,moveId: 0,moveOffset: 0) << Insert(index: 28,count: 1,moveId: 1,moveOffset: 7) << Insert(index: 29,count: 5,moveId: 1,moveOffset: 9) << Insert(index: 34,count: 2,moveId: 1,moveOffset: 18)); |
| 884 | |
| 885 | QTest::newRow(dataTag: "i(8,5),m(14,26,14)" ) |
| 886 | << (SignalList() << Insert(index: 8,count: 5) << Move(from: 14,to: 26,count: 14,moveId: 0)) |
| 887 | << (SignalList() << Remove(index: 9,count: 14,moveId: 0,moveOffset: 0) << Insert(index: 8,count: 5) << Insert(index: 26,count: 14,moveId: 0,moveOffset: 0)); |
| 888 | QTest::newRow(dataTag: "i(8,5),m(14,26,14),r(45,0)" ) |
| 889 | << (SignalList() << Insert(index: 8,count: 5) << Move(from: 14,to: 26,count: 14,moveId: 0) << Remove(index: 45,count: 0)) |
| 890 | << (SignalList() << Remove(index: 9,count: 14,moveId: 0,moveOffset: 0) << Insert(index: 8,count: 5) << Insert(index: 26,count: 14,moveId: 0,moveOffset: 0)); |
| 891 | QTest::newRow(dataTag: "i(8,5),m(14,26,14),r(45,0),m(5,8,21)" ) |
| 892 | << (SignalList() << Insert(index: 8,count: 5) << Move(from: 14,to: 26,count: 14,moveId: 0) << Remove(index: 45,count: 0) << Move(from: 5,to: 8,count: 21,moveId: 1)) |
| 893 | << (SignalList() << Remove(index: 5,count: 3,moveId: 1,moveOffset: 0) << Remove(index: 5,count: 1,moveId: 1,moveOffset: 8) << Remove(index: 5,count: 14,moveId: 0,moveOffset: 0) << Remove(index: 5,count: 12,moveId: 1,moveOffset: 9) |
| 894 | << Insert(index: 5,count: 3,moveId: 0,moveOffset: 0) << Insert(index: 8,count: 3,moveId: 1,moveOffset: 0) << Insert(index: 11,count: 5) << Insert(index: 16,count: 13,moveId: 1,moveOffset: 8) << Insert(index: 29,count: 11,moveId: 0,moveOffset: 3)); |
| 895 | |
| 896 | QTest::newRow(dataTag: "i(35,1),r(5,31)" ) |
| 897 | << (SignalList() << Insert(index: 35,count: 1) << Remove(index: 5,count: 31)) |
| 898 | << (SignalList() << Remove(index: 5,count: 30)); |
| 899 | QTest::newRow(dataTag: "i(35,1),r(5,31),m(9,8,1)" ) |
| 900 | << (SignalList() << Insert(index: 35,count: 1) << Remove(index: 5,count: 31) << Move(from: 9,to: 8,count: 1,moveId: 0)) |
| 901 | << (SignalList() << Remove(index: 5,count: 30) << Remove(index: 9,count: 1,moveId: 0,moveOffset: 0) << Insert(index: 8,count: 1,moveId: 0,moveOffset: 0)); |
| 902 | QTest::newRow(dataTag: "i(35,1),r(5,31),m(9,8,1),i(7,2)" ) |
| 903 | << (SignalList() << Insert(index: 35,count: 1) << Remove(index: 5,count: 31) << Move(from: 9,to: 8,count: 1,moveId: 0) << Insert(index: 7,count: 2)) |
| 904 | << (SignalList() << Remove(index: 5,count: 30) << Remove(index: 9,count: 1,moveId: 0,moveOffset: 0) << Insert(index: 7,count: 2) << Insert(index: 10,count: 1,moveId: 0,moveOffset: 0)); |
| 905 | QTest::newRow(dataTag: "i(35,1),r(5,31),m(9,8,1),i(7,2),r(4,3)" ) |
| 906 | << (SignalList() << Insert(index: 35,count: 1) << Remove(index: 5,count: 31) << Move(from: 9,to: 8,count: 1,moveId: 0) << Insert(index: 7,count: 2) << Remove(index: 4,count: 3)) |
| 907 | << (SignalList() << Remove(index: 4,count: 33) << Remove(index: 6,count: 1,moveId: 0,moveOffset: 0) << Insert(index: 4,count: 2) << Insert(index: 7,count: 1,moveId: 0,moveOffset: 0)); |
| 908 | |
| 909 | QTest::newRow(dataTag: "r(37,0),r(21,1)" ) |
| 910 | << (SignalList() << Remove(index: 37,count: 0) << Remove(index: 21,count: 1)) |
| 911 | << (SignalList() << Remove(index: 21,count: 1)); |
| 912 | QTest::newRow(dataTag: "r(37,0),r(21,1),m(27,35,2)" ) |
| 913 | << (SignalList() << Remove(index: 37,count: 0) << Remove(index: 21,count: 1) << Move(from: 27,to: 35,count: 2,moveId: 0)) |
| 914 | << (SignalList() << Remove(index: 21,count: 1) << Remove(index: 27,count: 2,moveId: 0,moveOffset: 0) << Insert(index: 35,count: 2,moveId: 0,moveOffset: 0)); |
| 915 | QTest::newRow(dataTag: "r(37,0),r(21,1),m(27,35,2),i(31,5)" ) |
| 916 | << (SignalList() << Remove(index: 37,count: 0) << Remove(index: 21,count: 1) << Move(from: 27,to: 35,count: 2,moveId: 0) << Insert(index: 31,count: 5)) |
| 917 | << (SignalList() << Remove(index: 21,count: 1) << Remove(index: 27,count: 2,moveId: 0,moveOffset: 0) << Insert(index: 31,count: 5) << Insert(index: 40,count: 2,moveId: 0,moveOffset: 0)); |
| 918 | QTest::newRow(dataTag: "r(37,0),r(21,1),m(27,35,2),i(31,5),r(10,31)" ) |
| 919 | << (SignalList() << Remove(index: 37,count: 0) << Remove(index: 21,count: 1) << Move(from: 27,to: 35,count: 2,moveId: 0) << Insert(index: 31,count: 5) << Remove(index: 10,count: 31)) |
| 920 | << (SignalList() << Remove(index: 10, count: 18) << Remove(index: 10,count: 2,moveId: 0,moveOffset: 0) << Remove(index: 10,count: 8) << Insert(index: 10,count: 1,moveId: 0,moveOffset: 1)); |
| 921 | |
| 922 | QTest::newRow(dataTag: "m(1,1,39),r(26,10)" ) |
| 923 | << (SignalList() << Move(from: 1,to: 1,count: 39,moveId: 0) << Remove(index: 26,count: 10)) |
| 924 | << (SignalList() << Remove(index: 1,count: 39,moveId: 0,moveOffset: 0) << Insert(index: 1,count: 25,moveId: 0,moveOffset: 0) << Insert(index: 26,count: 4,moveId: 0,moveOffset: 35)); |
| 925 | QTest::newRow(dataTag: "m(1,1,39),r(26,10),i(10,5)" ) |
| 926 | << (SignalList() << Move(from: 1,to: 1,count: 39,moveId: 0) << Remove(index: 26,count: 10) << Insert(index: 10,count: 5)) |
| 927 | << (SignalList() << Remove(index: 1,count: 39,moveId: 0,moveOffset: 0) << Insert(index: 1,count: 9,moveId: 0,moveOffset: 0) << Insert(index: 10,count: 5) << Insert(index: 15,count: 16,moveId: 0,moveOffset: 9) << Insert(index: 31,count: 4,moveId: 0,moveOffset: 35)); |
| 928 | QTest::newRow(dataTag: "m(1,1,39),r(26,10),i(10,5),i(27,3)" ) |
| 929 | << (SignalList() << Move(from: 1,to: 1,count: 39,moveId: 0) << Remove(index: 26,count: 10) << Insert(index: 10,count: 5) << Insert(index: 27,count: 3)) |
| 930 | << (SignalList() << Remove(index: 1,count: 39,moveId: 0,moveOffset: 0) |
| 931 | << Insert(index: 1,count: 9,moveId: 0,moveOffset: 0) << Insert(index: 10,count: 5) << Insert(index: 15,count: 12,moveId: 0,moveOffset: 9) << Insert(index: 27,count: 3) << Insert(index: 30,count: 4,moveId: 0,moveOffset: 21) << Insert(index: 34,count: 4,moveId: 0,moveOffset: 35)); |
| 932 | QTest::newRow(dataTag: "m(1,1,39),r(26,10),i(10,5),i(27,3),r(28,5)" ) |
| 933 | << (SignalList() << Move(from: 1,to: 1,count: 39,moveId: 0) << Remove(index: 26,count: 10) << Insert(index: 10,count: 5) << Insert(index: 27,count: 3) << Remove(index: 28,count: 5)) |
| 934 | << (SignalList() << Remove(index: 1,count: 39,moveId: 0,moveOffset: 0) |
| 935 | << Insert(index: 1,count: 9,moveId: 0,moveOffset: 0) << Insert(index: 10,count: 5) << Insert(index: 15,count: 12,moveId: 0,moveOffset: 9) << Insert(index: 27,count: 1) << Insert(index: 28,count: 1,moveId: 0,moveOffset: 24) << Insert(index: 29,count: 4,moveId: 0,moveOffset: 35)); |
| 936 | |
| 937 | QTest::newRow(dataTag: "i(36,4)m(25,39,5)" ) |
| 938 | << (SignalList() << Insert(index: 36,count: 4) << Move(from: 25,to: 39,count: 5,moveId: 0)) |
| 939 | << (SignalList() << Remove(index: 25,count: 5,moveId: 0,moveOffset: 0) << Insert(index: 31,count: 4) << Insert(index: 39,count: 5,moveId: 0,moveOffset: 0)); |
| 940 | QTest::newRow(dataTag: "i(36,4)m(25,39,5),i(16,5)" ) |
| 941 | << (SignalList() << Insert(index: 36,count: 4) << Move(from: 25,to: 39,count: 5,moveId: 0) << Insert(index: 16,count: 5)) |
| 942 | << (SignalList() << Remove(index: 25,count: 5,moveId: 0,moveOffset: 0) << Insert(index: 16,count: 5) << Insert(index: 36,count: 4) << Insert(index: 44,count: 5,moveId: 0,moveOffset: 0)); |
| 943 | QTest::newRow(dataTag: "i(36,4)m(25,39,5),i(16,5),i(37,5)" ) |
| 944 | << (SignalList() << Insert(index: 36,count: 4) << Move(from: 25,to: 39,count: 5,moveId: 0) << Insert(index: 16,count: 5) << Insert(index: 37,count: 5)) |
| 945 | << (SignalList() << Remove(index: 25,count: 5,moveId: 0,moveOffset: 0) << Insert(index: 16,count: 5) << Insert(index: 36,count: 9) << Insert(index: 49,count: 5,moveId: 0,moveOffset: 0)); |
| 946 | QTest::newRow(dataTag: "i(36,4)m(25,39,5),i(16,5),i(37,5),m(40,21,11)" ) |
| 947 | << (SignalList() << Insert(index: 36,count: 4) << Move(from: 25,to: 39,count: 5,moveId: 0) << Insert(index: 16,count: 5) << Insert(index: 37,count: 5) << Move(from: 40,to: 21,count: 11,moveId: 1)) |
| 948 | << (SignalList() << Remove(index: 25,count: 5,moveId: 0,moveOffset: 0) << Remove(index: 31,count: 4,moveId: 1,moveOffset: 5) |
| 949 | << Insert(index: 16,count: 10) << Insert(index: 26,count: 4,moveId: 1,moveOffset: 5) << Insert(index: 30,count: 2,moveId: 0,moveOffset: 0) << Insert(index: 47,count: 4) << Insert(index: 51,count: 3,moveId: 0,moveOffset: 2)); |
| 950 | |
| 951 | QTest::newRow(dataTag: "i(24,1),r(33,4)" ) |
| 952 | << (SignalList() << Insert(index: 24,count: 1) << Remove(index: 33,count: 4)) |
| 953 | << (SignalList() << Remove(index: 32,count: 4) << Insert(index: 24,count: 1)); |
| 954 | QTest::newRow(dataTag: "i(24,1),r(33,4),r(15,15)" ) |
| 955 | << (SignalList() << Insert(index: 24,count: 1) << Remove(index: 33,count: 4) << Remove(index: 15,count: 15)) |
| 956 | << (SignalList() << Remove(index: 15,count: 14) << Remove(index: 18,count: 4)); |
| 957 | QTest::newRow(dataTag: "i(24,1),r(33,4),r(15,15),m(8,10,2)" ) |
| 958 | << (SignalList() << Insert(index: 24,count: 1) << Remove(index: 33,count: 4) << Remove(index: 15,count: 15) << Move(from: 8,to: 10,count: 2,moveId: 0)) |
| 959 | << (SignalList() << Remove(index: 8,count: 2,moveId: 0,moveOffset: 0) << Remove(index: 13,count: 14) << Remove(index: 16,count: 4) << Insert(index: 10,count: 2,moveId: 0,moveOffset: 0)); |
| 960 | QTest::newRow(dataTag: "i(24,1),r(33,4),r(15,15),m(8,10,2),r(2,19)" ) |
| 961 | << (SignalList() << Insert(index: 24,count: 1) << Remove(index: 33,count: 4) << Remove(index: 15,count: 15) << Move(from: 8,to: 10,count: 2,moveId: 0) << Remove(index: 2,count: 19)) |
| 962 | << (SignalList() << Remove(index: 2,count: 6) << Remove(index: 2,count: 2,moveId: 0,moveOffset: 0) << Remove(index: 2,count: 29)); |
| 963 | |
| 964 | QTest::newRow(dataTag: "r(1,35),i(3,4),m(4,2,2)" ) |
| 965 | << (SignalList() << Remove(index: 1,count: 35) << Insert(index: 3,count: 4) << Move(from: 4,to: 2,count: 2,moveId: 0)) |
| 966 | << (SignalList() << Remove(index: 1,count: 35) <<Insert(index: 2,count: 2) << Insert(index: 5,count: 2)); |
| 967 | QTest::newRow(dataTag: "r(1,35),i(3,4),m(4,2,2),r(7,1)" ) |
| 968 | << (SignalList() << Remove(index: 1,count: 35) << Insert(index: 3,count: 4) << Move(from: 4,to: 2,count: 2,moveId: 0) << Remove(index: 7,count: 1)) |
| 969 | << (SignalList() << Remove(index: 1,count: 35) << Remove(index: 3,count: 1) << Insert(index: 2,count: 2) << Insert(index: 5,count: 2)); |
| 970 | |
| 971 | QTest::newRow(dataTag: "i(30,4),m(7,28,16),m(6,7,13)" ) |
| 972 | << (SignalList() << Insert(index: 30,count: 4) << Move(from: 7,to: 28,count: 16,moveId: 0)) |
| 973 | << (SignalList() << Remove(index: 7,count: 16,moveId: 0,moveOffset: 0) << Insert(index: 14,count: 4) << Insert(index: 28,count: 16,moveId: 0,moveOffset: 0)); |
| 974 | QTest::newRow(dataTag: "(i(30,4),m(7,28,16),m(6,7,13),m(41,35,2)" ) |
| 975 | << (SignalList() << Insert(index: 30,count: 4) << Move(from: 7,to: 28,count: 16,moveId: 0) << Move(from: 6,to: 7,count: 13,moveId: 1) << Move(from: 41,to: 35,count: 2,moveId: 2)) |
| 976 | << (SignalList() << Remove(index: 6,count: 1,moveId: 1,moveOffset: 0) << Remove(index: 6,count: 16,moveId: 0,moveOffset: 0) << Remove(index: 6,count: 7,moveId: 1,moveOffset: 1) << Remove(index: 6,count: 1,moveId: 1,moveOffset: 12) |
| 977 | << Insert(index: 7,count: 8,moveId: 1,moveOffset: 0) << Insert(index: 15,count: 4) << Insert(index: 19,count: 1,moveId: 1,moveOffset: 12) << Insert(index: 28,count: 7,moveId: 0,moveOffset: 0) << Insert(index: 35,count: 2,moveId: 0,moveOffset: 13) << Insert(index: 37,count: 6,moveId: 0,moveOffset: 7) << Insert(index: 43,count: 1,moveId: 0,moveOffset: 15)); |
| 978 | |
| 979 | QTest::newRow(dataTag: "(i(35,2),r(39,0))(r(25,11))" ) |
| 980 | << (SignalList() << Insert(index: 35,count: 2) << Remove(index: 39,count: 0) << Remove(index: 25,count: 11)) |
| 981 | << (SignalList() << Remove(index: 25,count: 10) << Insert(index: 25,count: 1)); |
| 982 | QTest::newRow(dataTag: "(i(35,2),r(39,0))(r(25,11),m(28,8,7))" ) |
| 983 | << (SignalList() << Insert(index: 35,count: 2) << Remove(index: 39,count: 0) << Remove(index: 25,count: 11) << Move(from: 24,to: 8,count: 7,moveId: 0)) |
| 984 | << (SignalList() << Remove(index: 24,count: 1,moveId: 0,moveOffset: 0) << Remove(index: 24,count: 10) << Remove(index: 24,count: 5,moveId: 0,moveOffset: 2) |
| 985 | << Insert(index: 8,count: 1,moveId: 0,moveOffset: 0) << Insert(index: 9,count: 1) << Insert(index: 10,count: 5,moveId: 0,moveOffset: 2)); |
| 986 | |
| 987 | QTest::newRow(dataTag: "i(26,1),i(39,1)" ) |
| 988 | << (SignalList() << Insert(index: 26,count: 1) << Insert(index: 39,count: 1)) |
| 989 | << (SignalList() << Insert(index: 26,count: 1) << Insert(index: 39,count: 1)); |
| 990 | QTest::newRow(dataTag: "i(26,1),i(39,1),m(31,34,2)" ) |
| 991 | << (SignalList() << Insert(index: 26,count: 1) << Insert(index: 39,count: 1) << Move(from: 31,to: 34,count: 2,moveId: 0)) |
| 992 | << (SignalList() << Remove(index: 30,count: 2,moveId: 0,moveOffset: 0) << Insert(index: 26,count: 1) << Insert(index: 34,count: 2,moveId: 0,moveOffset: 0) << Insert(index: 39,count: 1)); |
| 993 | QTest::newRow(dataTag: "i(26,1),i(39,1),m(31,34,2),r(15,27)" ) |
| 994 | << (SignalList() << Insert(index: 26,count: 1) << Insert(index: 39,count: 1) << Move(from: 31,to: 34,count: 2,moveId: 0) << Remove(index: 15,count: 27)) |
| 995 | << (SignalList() << Remove(index: 15,count: 15) << Remove(index: 15,count: 2,moveId: 0,moveOffset: 0) << Remove(index: 15,count: 8)); |
| 996 | |
| 997 | QTest::newRow(dataTag: "i(19,1),i(2,3)" ) |
| 998 | << (SignalList() << Insert(index: 19,count: 1) << Insert(index: 2,count: 3)) |
| 999 | << (SignalList() << Insert(index: 2,count: 3) << Insert(index: 22,count: 1)); |
| 1000 | QTest::newRow(dataTag: "i(19,1),i(2,3),r(38,4)" ) |
| 1001 | << (SignalList() << Insert(index: 19,count: 1) << Insert(index: 2,count: 3) << Remove(index: 38,count: 4)) |
| 1002 | << (SignalList() << Remove(index: 34,count: 4) << Insert(index: 2,count: 3) << Insert(index: 22,count: 1)); |
| 1003 | QTest::newRow(dataTag: "i(19,1),(2,3),r(38,4),m(2,20,3" ) |
| 1004 | << (SignalList() << Insert(index: 19,count: 1) << Insert(index: 2,count: 3) << Remove(index: 38,count: 4) << Move(from: 2,to: 20,count: 3,moveId: 0)) |
| 1005 | << (SignalList() << Remove(index: 34,count: 4) << Insert(index: 19,count: 4)); |
| 1006 | |
| 1007 | QTest::newRow(dataTag: "i(4,3),i(19,1)" ) |
| 1008 | << (SignalList() << Insert(index: 4,count: 3) << Insert(index: 19,count: 1)) |
| 1009 | << (SignalList() << Insert(index: 4,count: 3) << Insert(index: 19,count: 1)); |
| 1010 | QTest::newRow(dataTag: "i(4,3),i(19,1),i(31,3)" ) |
| 1011 | << (SignalList() << Insert(index: 4,count: 3) << Insert(index: 19,count: 1) << Insert(index: 31,count: 3)) |
| 1012 | << (SignalList() << Insert(index: 4,count: 3) << Insert(index: 19,count: 1) << Insert(index: 31,count: 3)); |
| 1013 | QTest::newRow(dataTag: "i(4,3),i(19,1),i(31,3),m(8,10,29)" ) |
| 1014 | << (SignalList() << Insert(index: 4,count: 3) << Insert(index: 19,count: 1) << Insert(index: 31,count: 3) << Move(from: 8,to: 10,count: 29,moveId: 0)) |
| 1015 | << (SignalList() << Remove(index: 5,count: 11,moveId: 0,moveOffset: 0) << Remove(index: 5,count: 11,moveId: 0,moveOffset: 12) << Remove(index: 5,count: 3,moveId: 0,moveOffset: 26) |
| 1016 | << Insert(index: 4,count: 3) << Insert(index: 10,count: 11,moveId: 0,moveOffset: 0) << Insert(index: 21,count: 1) << Insert(index: 22,count: 11,moveId: 0,moveOffset: 12) << Insert(index: 33,count: 3) << Insert(index: 36,count: 3,moveId: 0,moveOffset: 26)); |
| 1017 | |
| 1018 | QTest::newRow(dataTag: "m(18,15,16),i(0,1)" ) |
| 1019 | << (SignalList() << Move(from: 18,to: 15,count: 16,moveId: 0) << Insert(index: 0,count: 1)) |
| 1020 | << (SignalList() << Remove(index: 18,count: 16,moveId: 0,moveOffset: 0) << Insert(index: 0,count: 1) << Insert(index: 16,count: 16,moveId: 0,moveOffset: 0)); |
| 1021 | QTest::newRow(dataTag: "m(18,15,16),i(0,1),i(32,2)" ) |
| 1022 | << (SignalList() << Move(from: 18,to: 15,count: 16,moveId: 0) << Insert(index: 0,count: 1) << Insert(index: 32,count: 2)) |
| 1023 | << (SignalList() << Remove(index: 18,count: 16,moveId: 0,moveOffset: 0) << Insert(index: 0,count: 1) << Insert(index: 16,count: 16,moveId: 0,moveOffset: 0) << Insert(index: 32,count: 2)); |
| 1024 | QTest::newRow(dataTag: "m(18,15,16),i(0,1),i(32,2),i(29,2)" ) |
| 1025 | << (SignalList() << Move(from: 18,to: 15,count: 16,moveId: 0) << Insert(index: 0,count: 1) << Insert(index: 32,count: 2) << Insert(index: 29,count: 2)) |
| 1026 | << (SignalList() << Remove(index: 18,count: 16,moveId: 0,moveOffset: 0) << Insert(index: 0,count: 1) << Insert(index: 16,count: 13,moveId: 0,moveOffset: 0) << Insert(index: 29,count: 2) << Insert(index: 31,count: 3,moveId: 0,moveOffset: 13) << Insert(index: 34,count: 2)); |
| 1027 | |
| 1028 | QTest::newRow(dataTag: "i(38,5),i(12,5)" ) |
| 1029 | << (SignalList() << Insert(index: 38,count: 5) << Insert(index: 12,count: 5)) |
| 1030 | << (SignalList() << Insert(index: 12,count: 5) << Insert(index: 43,count: 5)); |
| 1031 | QTest::newRow(dataTag: "i(38,5),i(12,5),i(48,3)" ) |
| 1032 | << (SignalList() << Insert(index: 38,count: 5) << Insert(index: 12,count: 5) << Insert(index: 48,count: 3)) |
| 1033 | << (SignalList() << Insert(index: 12,count: 5) << Insert(index: 43,count: 8)); |
| 1034 | QTest::newRow(dataTag: "i(38,5),i(12,5),i(48,3),m(28,6,6)" ) |
| 1035 | << (SignalList() << Insert(index: 38,count: 5) << Insert(index: 12,count: 5) << Insert(index: 48,count: 3) << Move(from: 28,to: 6,count: 6,moveId: 0)) |
| 1036 | << (SignalList() << Remove(index: 23,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 6,count: 6,moveId: 0,moveOffset: 0) << Insert(index: 18,count: 5) << Insert(index: 43,count: 8)); |
| 1037 | |
| 1038 | QTest::newRow(dataTag: "r(8,9),m(7,10,18)" ) |
| 1039 | << (SignalList() << Remove(index: 8,count: 9) << Move(from: 7,to: 10,count: 18,moveId: 0)) |
| 1040 | << (SignalList() << Remove(index: 7,count: 1,moveId: 0,moveOffset: 0) << Remove(index: 7,count: 9) << Remove(index: 7,count: 17,moveId: 0,moveOffset: 1) << Insert(index: 10,count: 18,moveId: 0,moveOffset: 0)); |
| 1041 | QTest::newRow(dataTag: "r(8,9),m(7,10,18),m(8,10,18)" ) |
| 1042 | << (SignalList() << Remove(index: 8,count: 9) << Move(from: 7,to: 10,count: 18,moveId: 0) << Move(from: 8,to: 10,count: 18,moveId: 1)) |
| 1043 | << (SignalList() << Remove(index: 7,count: 1,moveId: 0,moveOffset: 0) << Remove(index: 7,count: 9) << Remove(index: 7,count: 17,moveId: 0,moveOffset: 1) << Remove(index: 8,count: 2,moveId: 1,moveOffset: 0) << Insert(index: 8,count: 2,moveId: 0,moveOffset: 16) << Insert(index: 10,count: 2,moveId: 1,moveOffset: 0) << Insert(index: 12,count: 16,moveId: 0,moveOffset: 0)); |
| 1044 | QTest::newRow(dataTag: "r(8,9),m(7,10,18),m(8,10,18),i(17,2)" ) |
| 1045 | << (SignalList() << Remove(index: 8,count: 9) << Move(from: 7,to: 10,count: 18,moveId: 0) << Move(from: 8,to: 10,count: 18,moveId: 1) << Insert(index: 17,count: 2)) |
| 1046 | << (SignalList() << Remove(index: 7,count: 1,moveId: 0,moveOffset: 0) << Remove(index: 7,count: 9) << Remove(index: 7,count: 17,moveId: 0,moveOffset: 1) << Remove(index: 8,count: 2,moveId: 1,moveOffset: 0) << Insert(index: 8,count: 2,moveId: 0,moveOffset: 16) << Insert(index: 10,count: 2,moveId: 1,moveOffset: 0) << Insert(index: 12,count: 5,moveId: 0,moveOffset: 0) << Insert(index: 17,count: 2) << Insert(index: 19,count: 11,moveId: 0,moveOffset: 5)); |
| 1047 | |
| 1048 | QTest::newRow(dataTag: "r(39,0),m(18,1,21)" ) |
| 1049 | << (SignalList() << Remove(index: 39,count: 0) << Move(from: 18,to: 1,count: 21,moveId: 0)) |
| 1050 | << (SignalList() << Remove(index: 18,count: 21,moveId: 0,moveOffset: 0) << Insert(index: 1,count: 21,moveId: 0,moveOffset: 0)); |
| 1051 | QTest::newRow(dataTag: "r(39,0),m(18,1,21),m(2,6,31)" ) |
| 1052 | << (SignalList() << Remove(index: 39,count: 0) << Move(from: 18,to: 1,count: 21,moveId: 0) << Move(from: 2,to: 6,count: 31,moveId: 1)) |
| 1053 | << (SignalList() << Remove(index: 1,count: 11,moveId: 1,moveOffset: 20) << Remove(index: 7,count: 21,moveId: 0,moveOffset: 0) << Insert(index: 1,count: 1,moveId: 0,moveOffset: 0) << Insert(index: 6,count: 20,moveId: 0,moveOffset: 1) << Insert(index: 26,count: 11,moveId: 1,moveOffset: 20)); |
| 1054 | QTest::newRow(dataTag: "r(39,0),m(18,1,21),m(2,6,31),r(9,4)" ) |
| 1055 | << (SignalList() << Remove(index: 39,count: 0) << Move(from: 18,to: 1,count: 21,moveId: 0) << Move(from: 2,to: 6,count: 31,moveId: 1) << Remove(index: 9,count: 4)) |
| 1056 | << (SignalList() << Remove(index: 1,count: 11,moveId: 1,moveOffset: 20) << Remove(index: 7,count: 21,moveId: 0,moveOffset: 0) << Insert(index: 1,count: 1,moveId: 0,moveOffset: 0) << Insert(index: 6,count: 3,moveId: 0,moveOffset: 1) << Insert(index: 9,count: 13,moveId: 0,moveOffset: 8) << Insert(index: 22,count: 11,moveId: 1,moveOffset: 20)); |
| 1057 | |
| 1058 | QTest::newRow(dataTag: "i(1,1),m(9,32,3)" ) |
| 1059 | << (SignalList() |
| 1060 | << Insert(index: 1,count: 1) << Move(from: 9,to: 32,count: 3,moveId: 0)) |
| 1061 | << (SignalList() << Remove(index: 8,count: 3,moveId: 0,moveOffset: 0) << Insert(index: 1,count: 1) << Insert(index: 32,count: 3,moveId: 0,moveOffset: 0)); |
| 1062 | QTest::newRow(dataTag: "i(1,1),m(9,32,3),r(22,1)" ) |
| 1063 | << (SignalList() |
| 1064 | << Insert(index: 1,count: 1) << Move(from: 9,to: 32,count: 3,moveId: 0) << Remove(index: 22,count: 1)) |
| 1065 | << (SignalList() << Remove(index: 8,count: 3,moveId: 0,moveOffset: 0) << Remove(index: 21,count: 1) << Insert(index: 1,count: 1) << Insert(index: 31,count: 3,moveId: 0,moveOffset: 0)); |
| 1066 | QTest::newRow(dataTag: "i(1,1),m(9,32,3),r(22,1),i(29,3)" ) |
| 1067 | << (SignalList() |
| 1068 | << Insert(index: 1,count: 1) << Move(from: 9,to: 32,count: 3,moveId: 0) << Remove(index: 22,count: 1) << Insert(index: 29,count: 3)) |
| 1069 | << (SignalList() << Remove(index: 8,count: 3,moveId: 0,moveOffset: 0) << Remove(index: 21,count: 1) << Insert(index: 1,count: 1) << Insert(index: 29,count: 3) << Insert(index: 34,count: 3,moveId: 0,moveOffset: 0)); |
| 1070 | QTest::newRow(dataTag: "i(1,1),m(9,32,3),r(22,1),i(29,3),m(7,15,23)" ) |
| 1071 | << (SignalList() |
| 1072 | << Insert(index: 1,count: 1) << Move(from: 9,to: 32,count: 3,moveId: 0) << Remove(index: 22,count: 1) << Insert(index: 29,count: 3) << Move(from: 7,to: 15,count: 23,moveId: 1)) |
| 1073 | << (SignalList() << Remove(index: 6,count: 2,moveId: 1,moveOffset: 0) << Remove(index: 6,count: 3,moveId: 0,moveOffset: 0) << Remove(index: 6,count: 13,moveId: 1,moveOffset: 2) << Remove(index: 6,count: 1) << Remove(index: 6,count: 7,moveId: 1,moveOffset: 15) << Insert(index: 1,count: 1) << Insert(index: 7,count: 2) << Insert(index: 11,count: 3,moveId: 0,moveOffset: 0) << Insert(index: 15,count: 22,moveId: 1,moveOffset: 0) << Insert(index: 37,count: 1)); |
| 1074 | |
| 1075 | QTest::newRow(dataTag: "r(36,4),m(3,2,14)" ) |
| 1076 | << (SignalList() << Remove(index: 36,count: 4) << Move(from: 3,to: 2,count: 14,moveId: 0)) |
| 1077 | << (SignalList() << Remove(index: 3,count: 14,moveId: 0,moveOffset: 0) << Remove(index: 22,count: 4) << Insert(index: 2,count: 14,moveId: 0,moveOffset: 0)); |
| 1078 | QTest::newRow(dataTag: "r(36,4),m(3,2,14),i(36,3)" ) |
| 1079 | << (SignalList() << Remove(index: 36,count: 4) << Move(from: 3,to: 2,count: 14,moveId: 0) << Insert(index: 36,count: 3)) |
| 1080 | << (SignalList() << Remove(index: 3,count: 14,moveId: 0,moveOffset: 0) << Remove(index: 22,count: 4) << Insert(index: 2,count: 14,moveId: 0,moveOffset: 0) << Insert(index: 36,count: 3)); |
| 1081 | QTest::newRow(dataTag: "r(36,4),m(3,2,14),i(36,3),r(30,7)" ) |
| 1082 | << (SignalList() << Remove(index: 36,count: 4) << Move(from: 3,to: 2,count: 14,moveId: 0) << Insert(index: 36,count: 3) << Remove(index: 30,count: 7)) |
| 1083 | << (SignalList() << Remove(index: 3,count: 14,moveId: 0,moveOffset: 0) << Remove(index: 16,count: 10) << Insert(index: 2,count: 14,moveId: 0,moveOffset: 0) << Insert(index: 30,count: 2)); // ### |
| 1084 | QTest::newRow(dataTag: "r(36,4),m(3,2,14),i(36,3),r(30,7),i(3,5)" ) |
| 1085 | << (SignalList() << Remove(index: 36,count: 4) << Move(from: 3,to: 2,count: 14,moveId: 0) << Insert(index: 36,count: 3) << Remove(index: 30,count: 7) << Insert(index: 3,count: 5)) |
| 1086 | << (SignalList() << Remove(index: 3,count: 14,moveId: 0,moveOffset: 0) << Remove(index: 16,count: 10) << Insert(index: 2,count: 1,moveId: 0,moveOffset: 0) << Insert(index: 3,count: 5) << Insert(index: 8,count: 13,moveId: 0,moveOffset: 1) << Insert(index: 35,count: 2)); // ### |
| 1087 | |
| 1088 | QTest::newRow(dataTag: "3*5 (10)" ) |
| 1089 | << (SignalList() |
| 1090 | << Remove(index: 36,count: 4) << Move(from: 3,to: 2,count: 14,moveId: 0) << Insert(index: 36,count: 3) << Remove(index: 30,count: 7) << Insert(index: 3,count: 5) |
| 1091 | << Insert(index: 1,count: 1) << Move(from: 9,to: 32,count: 3,moveId: 1) << Remove(index: 22,count: 1) << Insert(index: 29,count: 3) << Move(from: 7,to: 15,count: 23,moveId: 2)) |
| 1092 | << (SignalList() |
| 1093 | << Remove(index: 2,count: 1,moveId: 2,moveOffset: 12) << Remove(index: 2,count: 14,moveId: 0,moveOffset: 0) << Remove(index: 2,count: 2,moveId: 2,moveOffset: 13) << Remove(index: 2,count: 1) |
| 1094 | << Remove(index: 2,count: 7,moveId: 2,moveOffset: 15) << Remove(index: 5,count: 10) << Insert(index: 1,count: 1) << Insert(index: 3,count: 1,moveId: 0,moveOffset: 0) |
| 1095 | << Insert(index: 4,count: 3) << Insert(index: 7,count: 2) << Insert(index: 11,count: 3,moveId: 0,moveOffset: 1) << Insert(index: 15,count: 2) |
| 1096 | << Insert(index: 17,count: 10,moveId: 0,moveOffset: 4) << Insert(index: 27,count: 10,moveId: 2,moveOffset: 12) << Insert(index: 37,count: 3)); |
| 1097 | QTest::newRow(dataTag: "3*5 (11)" ) |
| 1098 | << (SignalList() |
| 1099 | << Remove(index: 36,count: 4) << Move(from: 3,to: 2,count: 14,moveId: 0) << Insert(index: 36,count: 3) << Remove(index: 30,count: 7) << Insert(index: 3,count: 5) |
| 1100 | << Insert(index: 1,count: 1) << Move(from: 9,to: 32,count: 3,moveId: 1) << Remove(index: 22,count: 1) << Insert(index: 29,count: 3) << Move(from: 7,to: 15,count: 23,moveId: 2) |
| 1101 | << Move(from: 38,to: 23,count: 1,moveId: 3)) |
| 1102 | << (SignalList() |
| 1103 | << Remove(index: 2,count: 1,moveId: 2,moveOffset: 12) << Remove(index: 2,count: 14,moveId: 0,moveOffset: 0) << Remove(index: 2,count: 2,moveId: 2,moveOffset: 13) |
| 1104 | << Remove(index: 2,count: 1) << Remove(index: 2,count: 7,moveId: 2,moveOffset: 15) << Remove(index: 5,count: 10) << Insert(index: 1,count: 1) |
| 1105 | << Insert(index: 3,count: 1,moveId: 0,moveOffset: 0) << Insert(index: 4,count: 3) << Insert(index: 7,count: 2) << Insert(index: 11,count: 3,moveId: 0,moveOffset: 1) << Insert(index: 15,count: 2) |
| 1106 | << Insert(index: 17,count: 6,moveId: 0,moveOffset: 4) << Insert(index: 23,count: 1) << Insert(index: 24,count: 4,moveId: 0,moveOffset: 10) << Insert(index: 28,count: 10,moveId: 2,moveOffset: 12) |
| 1107 | << Insert(index: 38,count: 2)); |
| 1108 | QTest::newRow(dataTag: "3*5 (12)" ) |
| 1109 | << (SignalList() |
| 1110 | << Remove(index: 36,count: 4) << Move(from: 3,to: 2,count: 14,moveId: 0) << Insert(index: 36,count: 3) << Remove(index: 30,count: 7) << Insert(index: 3,count: 5) |
| 1111 | << Insert(index: 1,count: 1) << Move(from: 9,to: 32,count: 3,moveId: 1) << Remove(index: 22,count: 1) << Insert(index: 29,count: 3) << Move(from: 7,to: 15,count: 23,moveId: 2) |
| 1112 | << Move(from: 38,to: 23,count: 1,moveId: 3) << Move(from: 38,to: 31,count: 0,moveId: 4)) |
| 1113 | << (SignalList() |
| 1114 | << Remove(index: 2,count: 1,moveId: 2,moveOffset: 12) << Remove(index: 2,count: 14,moveId: 0,moveOffset: 0) << Remove(index: 2,count: 2,moveId: 2,moveOffset: 13) << Remove(index: 2,count: 1) |
| 1115 | << Remove(index: 2,count: 7,moveId: 2,moveOffset: 15) << Remove(index: 5,count: 10) << Insert(index: 1,count: 1) << Insert(index: 3,count: 1,moveId: 0,moveOffset: 0) |
| 1116 | << Insert(index: 4,count: 3) << Insert(index: 7,count: 2) << Insert(index: 11,count: 3,moveId: 0,moveOffset: 1) << Insert(index: 15,count: 2) << Insert(index: 17,count: 6,moveId: 0,moveOffset: 4) |
| 1117 | << Insert(index: 23,count: 1) << Insert(index: 24,count: 4,moveId: 0,moveOffset: 10) << Insert(index: 28,count: 10,moveId: 2,moveOffset: 12) << Insert(index: 38,count: 2)); |
| 1118 | QTest::newRow(dataTag: "3*5 (13)" ) |
| 1119 | << (SignalList() |
| 1120 | << Remove(index: 36,count: 4) << Move(from: 3,to: 2,count: 14,moveId: 0) << Insert(index: 36,count: 3) << Remove(index: 30,count: 7) << Insert(index: 3,count: 5) |
| 1121 | << Insert(index: 1,count: 1) << Move(from: 9,to: 32,count: 3,moveId: 1) << Remove(index: 22,count: 1) << Insert(index: 29,count: 3) << Move(from: 7,to: 15,count: 23,moveId: 2) |
| 1122 | << Move(from: 38,to: 23,count: 1,moveId: 3) << Move(from: 38,to: 31,count: 0,moveId: 4) << Remove(index: 26,count: 11)) |
| 1123 | << (SignalList() |
| 1124 | << Remove(index: 2,count: 1,moveId: 2,moveOffset: 12) << Remove(index: 2,count: 14,moveId: 0,moveOffset: 0) << Remove(index: 2,count: 2,moveId: 2,moveOffset: 13) << Remove(index: 2,count: 1) |
| 1125 | << Remove(index: 2,count: 7,moveId: 2,moveOffset: 15) << Remove(index: 5,count: 10) << Insert(index: 1,count: 1) << Insert(index: 3,count: 1,moveId: 0,moveOffset: 0) |
| 1126 | << Insert(index: 4,count: 3) << Insert(index: 7,count: 2) << Insert(index: 11,count: 3,moveId: 0,moveOffset: 1) << Insert(index: 15,count: 2) << Insert(index: 17,count: 6,moveId: 0,moveOffset: 4) |
| 1127 | << Insert(index: 23,count: 1) << Insert(index: 24,count: 2,moveId: 0,moveOffset: 10) << Insert(index: 26,count: 1,moveId: 2,moveOffset: 21) << Insert(index: 27,count: 2)); |
| 1128 | QTest::newRow(dataTag: "3*5 (14)" ) |
| 1129 | << (SignalList() |
| 1130 | << Remove(index: 36,count: 4) << Move(from: 3,to: 2,count: 14,moveId: 0) << Insert(index: 36,count: 3) << Remove(index: 30,count: 7) << Insert(index: 3,count: 5) |
| 1131 | << Insert(index: 1,count: 1) << Move(from: 9,to: 32,count: 3,moveId: 1) << Remove(index: 22,count: 1) << Insert(index: 29,count: 3) << Move(from: 7,to: 15,count: 23,moveId: 2) |
| 1132 | << Move(from: 38,to: 23,count: 1,moveId: 3) << Move(from: 38,to: 31,count: 0,moveId: 4) << Remove(index: 26,count: 11) << Move(from: 5,to: 7,count: 18,moveId: 5)) |
| 1133 | << (SignalList() |
| 1134 | << Remove(index: 2,count: 1,moveId: 2,moveOffset: 12) << Remove(index: 2,count: 14,moveId: 0,moveOffset: 0) << Remove(index: 2,count: 2,moveId: 2,moveOffset: 13) << Remove(index: 2,count: 1) |
| 1135 | << Remove(index: 2,count: 7,moveId: 2,moveOffset: 15) << Remove(index: 2,count: 2,moveId: 5,moveOffset: 4) << Remove(index: 2,count: 1,moveId: 5,moveOffset: 9) << Remove(index: 2,count: 10) |
| 1136 | << Insert(index: 1,count: 1) << Insert(index: 3,count: 1,moveId: 0,moveOffset: 0) << Insert(index: 4,count: 1) << Insert(index: 5,count: 1) |
| 1137 | << Insert(index: 6,count: 1,moveId: 0,moveOffset: 10) << Insert(index: 7,count: 4) << Insert(index: 11,count: 2,moveId: 5,moveOffset: 4) |
| 1138 | << Insert(index: 13,count: 3,moveId: 0,moveOffset: 1) << Insert(index: 16,count: 1,moveId: 5,moveOffset: 9) << Insert(index: 17,count: 2) << Insert(index: 19,count: 6,moveId: 0,moveOffset: 4) |
| 1139 | << Insert(index: 25,count: 1,moveId: 0,moveOffset: 11) << Insert(index: 26,count: 1,moveId: 2,moveOffset: 21) << Insert(index: 27,count: 2)); |
| 1140 | QTest::newRow(dataTag: "3*5 (15)" ) |
| 1141 | << (SignalList() |
| 1142 | << Remove(index: 36,count: 4) << Move(from: 3,to: 2,count: 14,moveId: 0) << Insert(index: 36,count: 3) << Remove(index: 30,count: 7) << Insert(index: 3,count: 5) |
| 1143 | << Insert(index: 1,count: 1) << Move(from: 9,to: 32,count: 3,moveId: 1) << Remove(index: 22,count: 1) << Insert(index: 29,count: 3) << Move(from: 7,to: 15,count: 23,moveId: 2) |
| 1144 | << Move(from: 38,to: 23,count: 1,moveId: 3) << Move(from: 38,to: 31,count: 0,moveId: 4) << Remove(index: 26,count: 11) << Move(from: 5,to: 7,count: 18,moveId: 5) << Move(from: 19,to: 0,count: 8,moveId: 6)) |
| 1145 | << (SignalList() |
| 1146 | << Remove(index: 2,count: 1,moveId: 2,moveOffset: 12) << Remove(index: 2,count: 14,moveId: 0,moveOffset: 0) << Remove(index: 2,count: 2,moveId: 2,moveOffset: 13) << Remove(index: 2,count: 1) |
| 1147 | << Remove(index: 2,count: 7,moveId: 2,moveOffset: 15) << Remove(index: 2,count: 2,moveId: 5,moveOffset: 4) << Remove(index: 2,count: 1,moveId: 5,moveOffset: 9) << Remove(index: 2,count: 10) |
| 1148 | << Insert(index: 0,count: 6,moveId: 0,moveOffset: 4) << Insert(index: 6,count: 1,moveId: 0,moveOffset: 11) << Insert(index: 7,count: 1,moveId: 2,moveOffset: 21) << Insert(index: 9,count: 1) |
| 1149 | << Insert(index: 11,count: 1,moveId: 0,moveOffset: 0) << Insert(index: 12,count: 1) << Insert(index: 13,count: 1) << Insert(index: 14,count: 1,moveId: 0,moveOffset: 10) |
| 1150 | << Insert(index: 15,count: 4) << Insert(index: 19,count: 2,moveId: 5,moveOffset: 4) << Insert(index: 21,count: 3,moveId: 0,moveOffset: 1) |
| 1151 | << Insert(index: 24,count: 1,moveId: 5,moveOffset: 9) << Insert(index: 25,count: 2) << Insert(index: 27,count: 2)); |
| 1152 | } |
| 1153 | |
| 1154 | void tst_qqmlchangeset::sequence() |
| 1155 | { |
| 1156 | QFETCH(SignalList, input); |
| 1157 | QFETCH(SignalList, output); |
| 1158 | |
| 1159 | QQmlChangeSet set; |
| 1160 | |
| 1161 | foreach (const Signal &signal, input) { |
| 1162 | if (signal.isRemove()) |
| 1163 | set.remove(index: signal.index, count: signal.count); |
| 1164 | else if (signal.isInsert()) |
| 1165 | set.insert(index: signal.index, count: signal.count); |
| 1166 | else if (signal.isMove()) |
| 1167 | set.move(from: signal.index, to: signal.to, count: signal.count, moveId: signal.moveId); |
| 1168 | else if (signal.isChange()) |
| 1169 | set.change(index: signal.index, count: signal.count); |
| 1170 | } |
| 1171 | |
| 1172 | SignalList changes; |
| 1173 | foreach (const QQmlChangeSet::Change &remove, set.removes()) |
| 1174 | changes << Remove(index: remove.index, count: remove.count, moveId: remove.moveId, moveOffset: remove.offset); |
| 1175 | foreach (const QQmlChangeSet::Change &insert, set.inserts()) |
| 1176 | changes << Insert(index: insert.index, count: insert.count, moveId: insert.moveId, moveOffset: insert.offset); |
| 1177 | foreach (const QQmlChangeSet::Change &change, set.changes()) |
| 1178 | changes << Change(index: change.index, count: change.count); |
| 1179 | |
| 1180 | VERIFY_EXPECTED_OUTPUT |
| 1181 | QCOMPARE(changes, output); |
| 1182 | } |
| 1183 | |
| 1184 | void tst_qqmlchangeset::apply_data() |
| 1185 | { |
| 1186 | QTest::addColumn<SignalListList>(name: "input" ); |
| 1187 | |
| 1188 | QTest::newRow(dataTag: "(r(1,35),i(3,4)),(m(4,2,2),r(7,1))" ) |
| 1189 | << (SignalListList() |
| 1190 | << (SignalList() << Remove(index: 1,count: 35) << Insert(index: 3,count: 4)) |
| 1191 | << (SignalList() << Move(from: 4,to: 2,count: 2,moveId: 0) << Remove(index: 7,count: 1))); |
| 1192 | |
| 1193 | QTest::newRow(dataTag: "(i(30,4),m(7,28,16))(m(6,7,13),m(41,35,2))" ) |
| 1194 | << (SignalListList() |
| 1195 | << (SignalList() << Insert(index: 30,count: 4) << Move(from: 7,to: 28,count: 16,moveId: 0)) |
| 1196 | << (SignalList() << Move(from: 6,to: 7,count: 13,moveId: 1) << Move(from: 41,to: 35,count: 2,moveId: 2))); |
| 1197 | |
| 1198 | QTest::newRow(dataTag: "(i(35,2),r(39,0))(r(25,11),m(24,8,7))" ) |
| 1199 | << (SignalListList() |
| 1200 | << (SignalList() << Insert(index: 35,count: 2) << Remove(index: 39,count: 0)) |
| 1201 | << (SignalList() << Remove(index: 25,count: 11) << Move(from: 24,to: 8,count: 7,moveId: 0))); |
| 1202 | |
| 1203 | QTest::newRow(dataTag: "i(26,1),i(39,1),m(31,34,2),r(15,27)" ) |
| 1204 | << (SignalListList() |
| 1205 | << (SignalList() << Insert(index: 26,count: 1) << Insert(index: 39,count: 1)) |
| 1206 | << (SignalList() << Move(from: 31,to: 34,count: 2,moveId: 0) << Remove(index: 15,count: 27))); |
| 1207 | |
| 1208 | QTest::newRow(dataTag: "i(19,1),(2,3),r(38,4),m(2,20,3)" ) |
| 1209 | << (SignalListList() |
| 1210 | << (SignalList() << Insert(index: 19,count: 1) << Insert(index: 2,count: 3)) |
| 1211 | << (SignalList() << Remove(index: 38,count: 4) << Move(from: 2,to: 20,count: 3,moveId: 0))); |
| 1212 | |
| 1213 | QTest::newRow(dataTag: "i(4,3),i(19,1),i(31,3),m(8,10,29)" ) |
| 1214 | << (SignalListList() |
| 1215 | << (SignalList() << Insert(index: 4,count: 3) << Insert(index: 19,count: 1)) |
| 1216 | << (SignalList() << Insert(index: 31,count: 3) << Move(from: 8,to: 10,count: 29,moveId: 0))); |
| 1217 | |
| 1218 | QTest::newRow(dataTag: "m(18,15,16),i(0,1),i(32,2),i(29,2)" ) |
| 1219 | << (SignalListList() |
| 1220 | << (SignalList() << Move(from: 18,to: 15,count: 16,moveId: 0) << Insert(index: 0,count: 1)) |
| 1221 | << (SignalList() << Insert(index: 32,count: 2) << Insert(index: 29,count: 2))); |
| 1222 | |
| 1223 | QTest::newRow(dataTag: "i(38,5),i(12,5),i(48,3),m(28,6,6)" ) |
| 1224 | << (SignalListList() |
| 1225 | << (SignalList() << Insert(index: 38,count: 5) << Insert(index: 12,count: 5)) |
| 1226 | << (SignalList() << Insert(index: 48,count: 3) << Move(from: 28,to: 6,count: 6,moveId: 0))); |
| 1227 | |
| 1228 | QTest::newRow(dataTag: "r(8,9),m(7,10,18),m(8,10,18),i(17,2)" ) |
| 1229 | << (SignalListList() |
| 1230 | << (SignalList() << Remove(index: 8,count: 9) << Move(from: 7,to: 10,count: 18,moveId: 0)) |
| 1231 | << (SignalList() << Move(from: 8,to: 10,count: 18,moveId: 1) << Insert(index: 17,count: 2))); |
| 1232 | |
| 1233 | QTest::newRow(dataTag: "r(39,0),m(18,1,21),m(2,6,31),r(9,4)" ) |
| 1234 | << (SignalListList() |
| 1235 | << (SignalList() << Remove(index: 39,count: 0) << Move(from: 18,to: 1,count: 21,moveId: 0)) |
| 1236 | << (SignalList() << Move(from: 2,to: 6,count: 31,moveId: 1) << Remove(index: 9,count: 4))); |
| 1237 | |
| 1238 | QTest::newRow(dataTag: "3*5 (5)" ) |
| 1239 | << (SignalListList() |
| 1240 | << (SignalList() << Remove(index: 36,count: 4) << Move(from: 3,to: 2,count: 14,moveId: 0) << Insert(index: 36,count: 3) << Remove(index: 30,count: 7) << Insert(index: 3,count: 5))); |
| 1241 | QTest::newRow(dataTag: "3*5 (6)" ) |
| 1242 | << (SignalListList() |
| 1243 | << (SignalList() << Remove(index: 36,count: 4) << Move(from: 3,to: 2,count: 14,moveId: 0) << Insert(index: 36,count: 3) << Remove(index: 30,count: 7) << Insert(index: 3,count: 5)) |
| 1244 | << (SignalList() << Insert(index: 1,count: 1))); |
| 1245 | QTest::newRow(dataTag: "3*5 (7)" ) |
| 1246 | << (SignalListList() |
| 1247 | << (SignalList() << Remove(index: 36,count: 4) << Move(from: 3,to: 2,count: 14,moveId: 0) << Insert(index: 36,count: 3) << Remove(index: 30,count: 7) << Insert(index: 3,count: 5)) |
| 1248 | << (SignalList() << Insert(index: 1,count: 1) << Move(from: 9,to: 32,count: 3,moveId: 1))); |
| 1249 | QTest::newRow(dataTag: "3*5 (8)" ) |
| 1250 | << (SignalListList() |
| 1251 | << (SignalList() << Remove(index: 36,count: 4) << Move(from: 3,to: 2,count: 14,moveId: 0) << Insert(index: 36,count: 3) << Remove(index: 30,count: 7) << Insert(index: 3,count: 5)) |
| 1252 | << (SignalList() << Insert(index: 1,count: 1) << Move(from: 9,to: 32,count: 3,moveId: 1) << Remove(index: 22,count: 1))); |
| 1253 | QTest::newRow(dataTag: "3*5 (9)" ) |
| 1254 | << (SignalListList() |
| 1255 | << (SignalList() << Remove(index: 36,count: 4) << Move(from: 3,to: 2,count: 14,moveId: 0) << Insert(index: 36,count: 3) << Remove(index: 30,count: 7) << Insert(index: 3,count: 5)) |
| 1256 | << (SignalList() << Insert(index: 1,count: 1) << Move(from: 9,to: 32,count: 3,moveId: 1) << Remove(index: 22,count: 1) << Insert(index: 29,count: 3))); |
| 1257 | QTest::newRow(dataTag: "3*5 (10)" ) |
| 1258 | << (SignalListList() |
| 1259 | << (SignalList() << Remove(index: 36,count: 4) << Move(from: 3,to: 2,count: 14,moveId: 0) << Insert(index: 36,count: 3) << Remove(index: 30,count: 7) << Insert(index: 3,count: 5)) |
| 1260 | << (SignalList() << Insert(index: 1,count: 1) << Move(from: 9,to: 32,count: 3,moveId: 1) << Remove(index: 22,count: 1) << Insert(index: 29,count: 3) << Move(from: 7,to: 15,count: 23,moveId: 2))); |
| 1261 | QTest::newRow(dataTag: "3*5 (11)" ) |
| 1262 | << (SignalListList() |
| 1263 | << (SignalList() << Remove(index: 36,count: 4) << Move(from: 3,to: 2,count: 14,moveId: 0) << Insert(index: 36,count: 3) << Remove(index: 30,count: 7) << Insert(index: 3,count: 5)) |
| 1264 | << (SignalList() << Insert(index: 1,count: 1) << Move(from: 9,to: 32,count: 3,moveId: 1) << Remove(index: 22,count: 1) << Insert(index: 29,count: 3) << Move(from: 7,to: 15,count: 23,moveId: 2)) |
| 1265 | << (SignalList() << Move(from: 38,to: 23,count: 1,moveId: 3))); |
| 1266 | QTest::newRow(dataTag: "3*5 (12)" ) |
| 1267 | << (SignalListList() |
| 1268 | << (SignalList() << Remove(index: 36,count: 4) << Move(from: 3,to: 2,count: 14,moveId: 0) << Insert(index: 36,count: 3) << Remove(index: 30,count: 7) << Insert(index: 3,count: 5)) |
| 1269 | << (SignalList() << Insert(index: 1,count: 1) << Move(from: 9,to: 32,count: 3,moveId: 1) << Remove(index: 22,count: 1) << Insert(index: 29,count: 3) << Move(from: 7,to: 15,count: 23,moveId: 2)) |
| 1270 | << (SignalList() << Move(from: 38,to: 23,count: 1,moveId: 3) << Move(from: 38,to: 31,count: 0,moveId: 4))); |
| 1271 | QTest::newRow(dataTag: "3*5 (13)" ) |
| 1272 | << (SignalListList() |
| 1273 | << (SignalList() << Remove(index: 36,count: 4) << Move(from: 3,to: 2,count: 14,moveId: 0) << Insert(index: 36,count: 3) << Remove(index: 30,count: 7) << Insert(index: 3,count: 5)) |
| 1274 | << (SignalList() << Insert(index: 1,count: 1) << Move(from: 9,to: 32,count: 3,moveId: 1) << Remove(index: 22,count: 1) << Insert(index: 29,count: 3) << Move(from: 7,to: 15,count: 23,moveId: 2)) |
| 1275 | << (SignalList() << Move(from: 38,to: 23,count: 1,moveId: 3) << Move(from: 38,to: 31,count: 0,moveId: 4) << Remove(index: 26,count: 11))); |
| 1276 | QTest::newRow(dataTag: "3*5 (14)" ) |
| 1277 | << (SignalListList() |
| 1278 | << (SignalList() << Remove(index: 36,count: 4) << Move(from: 3,to: 2,count: 14,moveId: 0) << Insert(index: 36,count: 3) << Remove(index: 30,count: 7) << Insert(index: 3,count: 5)) |
| 1279 | << (SignalList() << Insert(index: 1,count: 1) << Move(from: 9,to: 32,count: 3,moveId: 1) << Remove(index: 22,count: 1) << Insert(index: 29,count: 3) << Move(from: 7,to: 15,count: 23,moveId: 2)) |
| 1280 | << (SignalList() << Move(from: 38,to: 23,count: 1,moveId: 3) << Move(from: 38,to: 31,count: 0,moveId: 4) << Remove(index: 26,count: 11) << Move(from: 5,to: 7,count: 18,moveId: 5))); |
| 1281 | QTest::newRow(dataTag: "3*5 (15)" ) |
| 1282 | << (SignalListList() |
| 1283 | << (SignalList() << Remove(index: 36,count: 4) << Move(from: 3,to: 2,count: 14,moveId: 0) << Insert(index: 36,count: 3) << Remove(index: 30,count: 7) << Insert(index: 3,count: 5)) |
| 1284 | << (SignalList() << Insert(index: 1,count: 1) << Move(from: 9,to: 32,count: 3,moveId: 1) << Remove(index: 22,count: 1) << Insert(index: 29,count: 3) << Move(from: 7,to: 15,count: 23,moveId: 2)) |
| 1285 | << (SignalList() << Move(from: 38,to: 23,count: 1,moveId: 3) << Move(from: 38,to: 31,count: 0,moveId: 4) << Remove(index: 26,count: 11) << Move(from: 5,to: 7,count: 18,moveId: 5) << Move(from: 19,to: 0,count: 8,moveId: 6))); |
| 1286 | } |
| 1287 | |
| 1288 | void tst_qqmlchangeset::apply() |
| 1289 | { |
| 1290 | QFETCH(SignalListList, input); |
| 1291 | |
| 1292 | QQmlChangeSet set; |
| 1293 | QQmlChangeSet linearSet; |
| 1294 | |
| 1295 | foreach (const SignalList &list, input) { |
| 1296 | QQmlChangeSet intermediateSet; |
| 1297 | foreach (const Signal &signal, list) { |
| 1298 | if (signal.isRemove()) { |
| 1299 | intermediateSet.remove(index: signal.index, count: signal.count); |
| 1300 | linearSet.remove(index: signal.index, count: signal.count); |
| 1301 | } else if (signal.isInsert()) { |
| 1302 | intermediateSet.insert(index: signal.index, count: signal.count); |
| 1303 | linearSet.insert(index: signal.index, count: signal.count); |
| 1304 | } else if (signal.isMove()) { |
| 1305 | intermediateSet.move(from: signal.index, to: signal.to, count: signal.count, moveId: signal.moveId); |
| 1306 | linearSet.move(from: signal.index, to: signal.to, count: signal.count, moveId: signal.moveId); |
| 1307 | } |
| 1308 | } |
| 1309 | set.apply(changeSet: intermediateSet); |
| 1310 | } |
| 1311 | |
| 1312 | SignalList changes; |
| 1313 | foreach (const QQmlChangeSet::Change &remove, set.removes()) |
| 1314 | changes << Remove(index: remove.index, count: remove.count, moveId: remove.moveId, moveOffset: remove.offset); |
| 1315 | foreach (const QQmlChangeSet::Change &insert, set.inserts()) |
| 1316 | changes << Insert(index: insert.index, count: insert.count, moveId: insert.moveId, moveOffset: insert.offset); |
| 1317 | |
| 1318 | SignalList linearChanges; |
| 1319 | foreach (const QQmlChangeSet::Change &remove, linearSet.removes()) |
| 1320 | linearChanges << Remove(index: remove.index, count: remove.count, moveId: remove.moveId, moveOffset: remove.offset); |
| 1321 | foreach (const QQmlChangeSet::Change &insert, linearSet.inserts()) |
| 1322 | linearChanges << Insert(index: insert.index, count: insert.count, moveId: insert.moveId, moveOffset: insert.offset); |
| 1323 | |
| 1324 | // The output in the failing tests isn't incorrect, merely sub-optimal. |
| 1325 | QEXPECT_FAIL("3*5 (10)" , "inserts not joined when dividing space removed" , Abort); |
| 1326 | QEXPECT_FAIL("3*5 (11)" , "inserts not joined when dividing space removed" , Abort); |
| 1327 | QEXPECT_FAIL("3*5 (12)" , "inserts not joined when dividing space removed" , Abort); |
| 1328 | QEXPECT_FAIL("3*5 (13)" , "inserts not joined when dividing space removed" , Abort); |
| 1329 | QEXPECT_FAIL("3*5 (14)" , "inserts not joined when dividing space removed" , Abort); |
| 1330 | QEXPECT_FAIL("3*5 (15)" , "inserts not joined when dividing space removed" , Abort); |
| 1331 | QCOMPARE(changes, linearChanges); |
| 1332 | } |
| 1333 | |
| 1334 | void tst_qqmlchangeset::removeConsecutive_data() |
| 1335 | { |
| 1336 | QTest::addColumn<SignalList>(name: "input" ); |
| 1337 | QTest::addColumn<SignalList>(name: "output" ); |
| 1338 | |
| 1339 | QTest::newRow(dataTag: "at start" ) |
| 1340 | << (SignalList() << Remove(index: 0,count: 2) << Remove(index: 0,count: 1) << Remove(index: 0,count: 5)) |
| 1341 | << (SignalList() << Remove(index: 0,count: 8)); |
| 1342 | QTest::newRow(dataTag: "offset" ) |
| 1343 | << (SignalList() << Remove(index: 3,count: 2) << Remove(index: 3,count: 1) << Remove(index: 3,count: 5)) |
| 1344 | << (SignalList() << Remove(index: 3,count: 8)); |
| 1345 | QTest::newRow(dataTag: "with move" ) |
| 1346 | << (SignalList() << Remove(index: 0,count: 2) << Remove(index: 0,count: 1,moveId: 0,moveOffset: 0) << Remove(index: 0,count: 5)) |
| 1347 | << (SignalList() << Remove(index: 0,count: 2) << Remove(index: 0,count: 1,moveId: 0,moveOffset: 0) << Remove(index: 0,count: 5)); |
| 1348 | } |
| 1349 | |
| 1350 | void tst_qqmlchangeset::removeConsecutive() |
| 1351 | { |
| 1352 | QFETCH(SignalList, input); |
| 1353 | QFETCH(SignalList, output); |
| 1354 | |
| 1355 | QVector<QQmlChangeSet::Change> removes; |
| 1356 | foreach (const Signal &signal, input) { |
| 1357 | QVERIFY(signal.isRemove()); |
| 1358 | removes.append(t: QQmlChangeSet::Change(signal.index, signal.count, signal.moveId, signal.offset)); |
| 1359 | } |
| 1360 | |
| 1361 | QQmlChangeSet set; |
| 1362 | set.remove(removes); |
| 1363 | |
| 1364 | SignalList changes; |
| 1365 | foreach (const QQmlChangeSet::Change &remove, set.removes()) |
| 1366 | changes << Remove(index: remove.index, count: remove.count, moveId: remove.moveId, moveOffset: remove.offset); |
| 1367 | QVERIFY(set.inserts().isEmpty()); |
| 1368 | QVERIFY(set.changes().isEmpty()); |
| 1369 | |
| 1370 | VERIFY_EXPECTED_OUTPUT |
| 1371 | QCOMPARE(changes, output); |
| 1372 | } |
| 1373 | |
| 1374 | void tst_qqmlchangeset::insertConsecutive_data() |
| 1375 | { |
| 1376 | QTest::addColumn<SignalList>(name: "input" ); |
| 1377 | QTest::addColumn<SignalList>(name: "output" ); |
| 1378 | |
| 1379 | QTest::newRow(dataTag: "at start" ) |
| 1380 | << (SignalList() << Insert(index: 0,count: 2) << Insert(index: 2,count: 1) << Insert(index: 3,count: 5)) |
| 1381 | << (SignalList() << Insert(index: 0,count: 8)); |
| 1382 | QTest::newRow(dataTag: "offset" ) |
| 1383 | << (SignalList() << Insert(index: 3,count: 2) << Insert(index: 5,count: 1) << Insert(index: 6,count: 5)) |
| 1384 | << (SignalList() << Insert(index: 3,count: 8)); |
| 1385 | QTest::newRow(dataTag: "with move" ) |
| 1386 | << (SignalList() << Insert(index: 0,count: 2) << Insert(index: 2,count: 1,moveId: 0,moveOffset: 0) << Insert(index: 3,count: 5)) |
| 1387 | << (SignalList() << Insert(index: 0,count: 2) << Insert(index: 2,count: 1,moveId: 0,moveOffset: 0) << Insert(index: 3,count: 5)); |
| 1388 | } |
| 1389 | |
| 1390 | void tst_qqmlchangeset::insertConsecutive() |
| 1391 | { |
| 1392 | QFETCH(SignalList, input); |
| 1393 | QFETCH(SignalList, output); |
| 1394 | |
| 1395 | QVector<QQmlChangeSet::Change> inserts; |
| 1396 | foreach (const Signal &signal, input) { |
| 1397 | QVERIFY(signal.isInsert()); |
| 1398 | inserts.append(t: QQmlChangeSet::Change(signal.index, signal.count, signal.moveId, signal.offset)); |
| 1399 | } |
| 1400 | |
| 1401 | QQmlChangeSet set; |
| 1402 | set.insert(inserts); |
| 1403 | |
| 1404 | SignalList changes; |
| 1405 | foreach (const QQmlChangeSet::Change &insert, set.inserts()) |
| 1406 | changes << Insert(index: insert.index, count: insert.count, moveId: insert.moveId, moveOffset: insert.offset); |
| 1407 | QVERIFY(set.removes().isEmpty()); |
| 1408 | QVERIFY(set.changes().isEmpty()); |
| 1409 | |
| 1410 | VERIFY_EXPECTED_OUTPUT |
| 1411 | QCOMPARE(changes, output); |
| 1412 | } |
| 1413 | |
| 1414 | void tst_qqmlchangeset::copy() |
| 1415 | { |
| 1416 | QQmlChangeSet changeSet; |
| 1417 | changeSet.remove(index: 0, count: 12); |
| 1418 | changeSet.remove(index: 5, count: 4); |
| 1419 | changeSet.insert(index: 3, count: 9); |
| 1420 | changeSet.insert(index: 15, count: 2); |
| 1421 | changeSet.change(index: 24, count: 8); |
| 1422 | changeSet.move(from: 3, to: 5, count: 9, moveId: 0); |
| 1423 | |
| 1424 | QQmlChangeSet copy(changeSet); |
| 1425 | |
| 1426 | QQmlChangeSet assign; |
| 1427 | assign = changeSet; |
| 1428 | |
| 1429 | copy.move(from: 4, to: 2, count: 5, moveId: 1); |
| 1430 | assign.move(from: 4, to: 2, count: 5, moveId: 1); |
| 1431 | changeSet.move(from: 4, to: 2, count: 5, moveId: 1); |
| 1432 | |
| 1433 | QCOMPARE(copy.removes(), changeSet.removes()); |
| 1434 | QCOMPARE(copy.inserts(), changeSet.inserts()); |
| 1435 | QCOMPARE(copy.changes(), changeSet.changes()); |
| 1436 | QCOMPARE(copy.difference(), changeSet.difference()); |
| 1437 | |
| 1438 | QCOMPARE(assign.removes(), changeSet.removes()); |
| 1439 | QCOMPARE(assign.inserts(), changeSet.inserts()); |
| 1440 | QCOMPARE(assign.changes(), changeSet.changes()); |
| 1441 | QCOMPARE(assign.difference(), changeSet.difference()); |
| 1442 | } |
| 1443 | |
| 1444 | void tst_qqmlchangeset::debug() |
| 1445 | { |
| 1446 | QQmlChangeSet changeSet; |
| 1447 | changeSet.remove(index: 0, count: 12); |
| 1448 | changeSet.remove(index: 5, count: 4); |
| 1449 | changeSet.insert(index: 3, count: 9); |
| 1450 | changeSet.insert(index: 15, count: 2); |
| 1451 | changeSet.change(index: 24, count: 8); |
| 1452 | |
| 1453 | QTest::ignoreMessage(type: QtDebugMsg, message: "QQmlChangeSet(Change(0,12) Change(5,4) Change(3,9) Change(15,2) Change(24,8) )" ); |
| 1454 | qDebug() << changeSet; |
| 1455 | |
| 1456 | changeSet.clear(); |
| 1457 | |
| 1458 | QTest::ignoreMessage(type: QtDebugMsg, message: "QQmlChangeSet(Change(12,4) Change(5,4) )" ); |
| 1459 | |
| 1460 | changeSet.move(from: 12, to: 5, count: 4, moveId: 0); |
| 1461 | qDebug() << changeSet; |
| 1462 | } |
| 1463 | |
| 1464 | void tst_qqmlchangeset::random_data() |
| 1465 | { |
| 1466 | QTest::addColumn<int>(name: "combinations" ); |
| 1467 | QTest::addColumn<int>(name: "depth" ); |
| 1468 | QTest::newRow(dataTag: "1*5" ) << 1 << 5; |
| 1469 | QTest::newRow(dataTag: "2*2" ) << 2 << 2; |
| 1470 | QTest::newRow(dataTag: "3*2" ) << 3 << 2; |
| 1471 | QTest::newRow(dataTag: "3*5" ) << 3 << 5; |
| 1472 | } |
| 1473 | |
| 1474 | void tst_qqmlchangeset::random() |
| 1475 | { |
| 1476 | QFETCH(int, combinations); |
| 1477 | QFETCH(int, depth); |
| 1478 | |
| 1479 | int failures = 0; |
| 1480 | for (int i = 0; i < 20000; ++i) { |
| 1481 | QQmlChangeSet accumulatedSet; |
| 1482 | SignalList input; |
| 1483 | |
| 1484 | int modelCount = 40; |
| 1485 | int moveCount = 0; |
| 1486 | |
| 1487 | for (int j = 0; j < combinations; ++j) { |
| 1488 | QQmlChangeSet set; |
| 1489 | for (int k = 0; k < depth; ++k) { |
| 1490 | switch (-QRandomGenerator::global()->bounded(highest: 3)) { |
| 1491 | case InsertOp: { |
| 1492 | int index = QRandomGenerator::global()->bounded(highest: modelCount + 1); |
| 1493 | int count = QRandomGenerator::global()->bounded(highest: 5) + 1; |
| 1494 | set.insert(index, count); |
| 1495 | input.append(t: Insert(index, count)); |
| 1496 | modelCount += count; |
| 1497 | break; |
| 1498 | } |
| 1499 | case RemoveOp: { |
| 1500 | const int index = QRandomGenerator::global()->bounded(highest: modelCount + 1); |
| 1501 | const int count = QRandomGenerator::global()->bounded(highest: modelCount - index + 1); |
| 1502 | set.remove(index, count); |
| 1503 | input.append(t: Remove(index, count)); |
| 1504 | modelCount -= count; |
| 1505 | break; |
| 1506 | } |
| 1507 | case MoveOp: { |
| 1508 | const int from = QRandomGenerator::global()->bounded(highest: modelCount + 1); |
| 1509 | const int count = QRandomGenerator::global()->bounded(highest: modelCount - from + 1); |
| 1510 | const int to = QRandomGenerator::global()->bounded(highest: modelCount - count + 1); |
| 1511 | const int moveId = moveCount++; |
| 1512 | set.move(from, to, count, moveId); |
| 1513 | input.append(t: Move(from, to, count, moveId)); |
| 1514 | break; |
| 1515 | } |
| 1516 | default: |
| 1517 | break; |
| 1518 | } |
| 1519 | } |
| 1520 | accumulatedSet.apply(changeSet: set); |
| 1521 | } |
| 1522 | |
| 1523 | SignalList output; |
| 1524 | foreach (const QQmlChangeSet::Change &remove, accumulatedSet.removes()) |
| 1525 | output << Remove(index: remove.index, count: remove.count, moveId: remove.moveId, moveOffset: remove.offset); |
| 1526 | foreach (const QQmlChangeSet::Change &insert, accumulatedSet.inserts()) |
| 1527 | output << Insert(index: insert.index, count: insert.count, moveId: insert.moveId, moveOffset: insert.offset); |
| 1528 | |
| 1529 | QVector<int> inputList; |
| 1530 | for (int i = 0; i < 40; ++i) |
| 1531 | inputList.append(t: i); |
| 1532 | QVector<int> outputList = inputList; |
| 1533 | if (!applyChanges(list&: inputList, changes: input)) { |
| 1534 | qDebug() << "Invalid input list" ; |
| 1535 | qDebug() << input; |
| 1536 | qDebug() << inputList; |
| 1537 | ++failures; |
| 1538 | } else if (!applyChanges(list&: outputList, changes: output)) { |
| 1539 | qDebug() << "Invalid output list" ; |
| 1540 | qDebug() << input; |
| 1541 | qDebug() << output; |
| 1542 | qDebug() << outputList; |
| 1543 | ++failures; |
| 1544 | } else if (outputList != inputList) { |
| 1545 | qDebug() << "Input/output mismatch" ; |
| 1546 | qDebug() << input; |
| 1547 | qDebug() << output; |
| 1548 | qDebug() << inputList; |
| 1549 | qDebug() << outputList; |
| 1550 | ++failures; |
| 1551 | } |
| 1552 | } |
| 1553 | QCOMPARE(failures, 0); |
| 1554 | } |
| 1555 | |
| 1556 | QTEST_MAIN(tst_qqmlchangeset) |
| 1557 | |
| 1558 | #include "tst_qqmlchangeset.moc" |
| 1559 | |