diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-03-03 13:48:37 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2010-03-03 13:52:28 (GMT) |
commit | 6f07f0a2b9df84302348e290f22de13514f81d50 (patch) | |
tree | ed5d2d840e5c863299e816361ce3be02b4b2e126 | |
parent | 69acbc34d5413e1e7642f1d533e39a8f0137051b (diff) | |
download | Qt-6f07f0a2b9df84302348e290f22de13514f81d50.zip Qt-6f07f0a2b9df84302348e290f22de13514f81d50.tar.gz Qt-6f07f0a2b9df84302348e290f22de13514f81d50.tar.bz2 |
test qlist some more
-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 a590fca..e2944cc 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; |