diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-03-03 14:48:37 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-03-03 14:52:28 +0100 |
commit | 6f07f0a2b9df84302348e290f22de13514f81d50 (patch) | |
tree | ed5d2d840e5c863299e816361ce3be02b4b2e126 /tests/auto/qlist/tst_qlist.cpp | |
parent | 69acbc34d5413e1e7642f1d533e39a8f0137051b (diff) | |
download | qt4-tools-6f07f0a2b9df84302348e290f22de13514f81d50.tar.gz |
test qlist some more
Diffstat (limited to 'tests/auto/qlist/tst_qlist.cpp')
-rw-r--r-- | tests/auto/qlist/tst_qlist.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/auto/qlist/tst_qlist.cpp b/tests/auto/qlist/tst_qlist.cpp index a590fca92b..e2944cccdc 100644 --- a/tests/auto/qlist/tst_qlist.cpp +++ b/tests/auto/qlist/tst_qlist.cpp @@ -60,6 +60,7 @@ private slots: void length() const; void lengthSignature() const; void append() const; + void prepend() const; void mid() const; }; @@ -130,6 +131,39 @@ void tst_QList::append() const } +void tst_QList::prepend() const +{ + QList<QString *> list; + QString *str1 = new QString; + list.prepend(str1); + QVERIFY(list.size() == 1); + QVERIFY(list.at(0) == str1); + QString *str2 = new QString; + list.prepend(str2); + QVERIFY(list.size() == 2); + QVERIFY(list.at(0) == str2); + QVERIFY(list.at(1) == str1); + QString *str3 = new QString; + list.prepend(str3); + QVERIFY(list.size() == 3); + QVERIFY(list.at(0) == str3); + QVERIFY(list.at(1) == str2); + QVERIFY(list.at(2) == str1); + list.removeAll(str2); + delete str2; + QVERIFY(list.size() == 2); + QVERIFY(list.at(0) == str3); + QVERIFY(list.at(1) == str1); + QString *str4 = new QString; + list.prepend(str4); + QVERIFY(list.size() == 3); + QVERIFY(list.at(0) == str4); + QVERIFY(list.at(1) == str3); + QVERIFY(list.at(2) == str1); + qDeleteAll(list); + list.clear(); +} + void tst_QList::mid() const { QList<QString> list; |