[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
cblu
cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:47:20 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 5bdf05f3f65ca1ff8cbb5481106009b95adb7723
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Sep 26 20:26:06 2001 +0000
Added tests for count, sort, at insert, remove, current, last, first and more to qlist-test
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/kwq/tests/qt/qlist-test.chk b/WebCore/kwq/tests/qt/qlist-test.chk
index b5ac292..c97616e 100644
--- a/WebCore/kwq/tests/qt/qlist-test.chk
+++ b/WebCore/kwq/tests/qt/qlist-test.chk
@@ -1,8 +1,30 @@
-QList: [size: 7; items: 0, 1, 2, 3, 4, 5, 6]
-finding index of 2: 2
-QList: [size: 6; items: 1, 2, 3, 4, 5, 6]
-QList: [size: 5; items: 1, 2, 3, 4, 5]
-taking last item: 5
-QList: [size: 4; items: 1, 2, 3, 4]
-contains 3: 1
-contains 0: 0
+p0: QList: [size: 0; items: ]
+p1: QList: [size: 7; items: 0, 1, 2, 3, 4, 5, 6]
+p0 isEmpty: 1
+p1 isEmpty: 0
+p0 count: 0
+p1 count: 7
+p1 find index of 2: 2
+p1 removeFirst: QList: [size: 6; items: 1, 2, 3, 4, 5, 6]
+p1 removeLast: QList: [size: 5; items: 1, 2, 3, 4, 5]
+p1 take: 5 QList: [size: 4; items: 1, 2, 3, 4]
+p1 containsRef 3: 1
+p1 containsRef 0: 0
+p2 unsorted: QList: [size: 7; items: 6, 5, 4, 3, 2, 1, 0]
+p2 sorted: QList: [size: 7; items: 6, 0, 1, 2, 3, 5, 4]
+p1 at 2: 3
+p1 insert 7 in 1: QList: [size: 8; items: 1, 7, 8, 9, 10, 2, 3, 4]
+p1 remove: QList: [size: 7; items: 1, 7, 8, 9, 2, 3, 4]
+p1 remove 7: QList: [size: 6; items: 1, 8, 9, 2, 3, 4]
+p1 removeRef 8: QList: [size: 5; items: 1, 9, 2, 3, 4]
+p2 getLast: 4
+p2 current: 4
+p2 first: 6
+p2 last: 4
+p2 prev: 5
+p2 next: 4
+p2 prepend 9: QList: [size: 8; items: 9, 6, 0, 1, 2, 3, 5, 4]
+p1: QList: [size: 5; items: 1, 9, 2, 3, 4]
+p1 clear (autoDelete off): QList: [size: 0; items: ]
+p1 clear (autoDelete on): QList: [size: 0; items: ]
+p3 = p2: QList: [size: 8; items: 9, 6, 0, 1, 2, 3, 5, 4]
diff --git a/WebCore/kwq/tests/qt/qlist-test.cpp b/WebCore/kwq/tests/qt/qlist-test.cpp
index ce68b60..abe009b 100644
--- a/WebCore/kwq/tests/qt/qlist-test.cpp
+++ b/WebCore/kwq/tests/qt/qlist-test.cpp
@@ -8,7 +8,10 @@
int main() {
QList<int> p0;
-
+ QList<int> p1;
+ QList<int> p2;
+ QList<int> p3;
+
int i = 0;
int j = 1;
int k = 2;
@@ -16,30 +19,97 @@ int main() {
int m = 4;
int n = 5;
int o = 6;
+ int p = 7;
+ int q = 8;
+ int r = 9;
+ int s = 10;
- p0.append(&i);
- p0.append(&j);
- p0.append(&k);
- p0.append(&l);
- p0.append(&m);
- p0.append(&n);
- p0.append(&o);
-
- cout << p0 << endl;
+ p1.append(&i);
+ p1.append(&j);
+ p1.append(&k);
+ p1.append(&l);
+ p1.append(&m);
+ p1.append(&n);
+ p1.append(&o);
+
+ cout << "p0: " << p0 << endl;
+ cout << "p1: " << p1 << endl;
+
+ cout << "p0 isEmpty: " << p0.isEmpty() << endl;
+ cout << "p1 isEmpty: " << p1.isEmpty() << endl;
- cout << "finding index of 2: " << p0.find(&k) << endl;
+ cout << "p0 count: " << p0.count() << endl;
+ cout << "p1 count: " << p1.count() << endl;
+
+ cout << "p1 find index of 2: " << p1.find(&k) << endl;
- p0.removeFirst();
- cout << p0 << endl;
+ p1.removeFirst();
+ cout << "p1 removeFirst: " << p1 << endl;
- p0.removeLast();
- cout << p0 << endl;
+ p1.removeLast();
+ cout << "p1 removeLast: " << p1 << endl;
- cout << "taking last item: " << *(p0.take()) << endl;
- cout << p0 << endl;
+ cout << "p1 take: " << *(p1.take()) << " " << p1 << endl;
- cout << "contains 3: " << p0.containsRef(&l) << endl;
- cout << "contains 0: " << p0.containsRef(&i) << endl;
+ cout << "p1 containsRef 3: " << p1.containsRef(&l) << endl;
+ cout << "p1 containsRef 0: " << p1.containsRef(&i) << endl;
+
+ p2.append(&o);
+ p2.append(&n);
+ p2.append(&m);
+ p2.append(&l);
+ p2.append(&k);
+ p2.append(&j);
+ p2.append(&i);
+ cout << "p2 unsorted: " << p2 << endl;
+ p2.sort();
+ cout << "p2 sorted: " << p2 << endl; //heh?
+
+ int *n1;
+ n1 = p1.at(2);
+ cout << "p1 at 2: "<< *n1 << endl;
+
+ p1.insert(1, &p);
+ p1.insert(2, &q);
+ p1.insert(3, &r);
+ p1.insert(4, &s);
+ cout << "p1 insert 7 in 1: " << p1 << endl;
+
+ p1.remove();
+ cout << "p1 remove: " << p1 << endl;
+
+ p1.remove(&p);
+ cout << "p1 remove 7: " << p1 << endl;
+
+ p1.removeRef(&q);
+ cout << "p1 removeRef 8: " << p1 << endl;
+
+ int *n2;
+ n2 = p2.getLast();
+ cout << "p2 getLast: "<< *n2 << endl;
+ n2 = p2.current();
+ cout << "p2 current: "<< *n2 << endl;
+ n2 = p2.first();
+ cout << "p2 first: "<< *n2 << endl;
+ n2 = p2.last();
+ cout << "p2 last: "<< *n2 << endl;
+ n2 = p2.prev();
+ cout << "p2 prev: "<< *n2 << endl;
+ n2 = p2.next();
+ cout << "p2 next: "<< *n2 << endl;
+
+ p2.prepend(&r);
+ cout << "p2 prepend 9: "<< p2 << endl;
+
+ cout << "p1: "<< p1 << endl;
+ p1.setAutoDelete(FALSE);
+ p1.clear();
+ cout << "p1 clear (autoDelete off): "<< p1 << endl; // heh?
+ p1.setAutoDelete(TRUE);
+ p1.clear();
+ cout << "p1 clear (autoDelete on): "<< p1 << endl;
+ p3 = p2;
+ cout << "p3 = p2: "<< p3 << endl;
return 0;
}
diff --git a/WebCore/src/kwq/tests/qt/qlist-test.chk b/WebCore/src/kwq/tests/qt/qlist-test.chk
index b5ac292..c97616e 100644
--- a/WebCore/src/kwq/tests/qt/qlist-test.chk
+++ b/WebCore/src/kwq/tests/qt/qlist-test.chk
@@ -1,8 +1,30 @@
-QList: [size: 7; items: 0, 1, 2, 3, 4, 5, 6]
-finding index of 2: 2
-QList: [size: 6; items: 1, 2, 3, 4, 5, 6]
-QList: [size: 5; items: 1, 2, 3, 4, 5]
-taking last item: 5
-QList: [size: 4; items: 1, 2, 3, 4]
-contains 3: 1
-contains 0: 0
+p0: QList: [size: 0; items: ]
+p1: QList: [size: 7; items: 0, 1, 2, 3, 4, 5, 6]
+p0 isEmpty: 1
+p1 isEmpty: 0
+p0 count: 0
+p1 count: 7
+p1 find index of 2: 2
+p1 removeFirst: QList: [size: 6; items: 1, 2, 3, 4, 5, 6]
+p1 removeLast: QList: [size: 5; items: 1, 2, 3, 4, 5]
+p1 take: 5 QList: [size: 4; items: 1, 2, 3, 4]
+p1 containsRef 3: 1
+p1 containsRef 0: 0
+p2 unsorted: QList: [size: 7; items: 6, 5, 4, 3, 2, 1, 0]
+p2 sorted: QList: [size: 7; items: 6, 0, 1, 2, 3, 5, 4]
+p1 at 2: 3
+p1 insert 7 in 1: QList: [size: 8; items: 1, 7, 8, 9, 10, 2, 3, 4]
+p1 remove: QList: [size: 7; items: 1, 7, 8, 9, 2, 3, 4]
+p1 remove 7: QList: [size: 6; items: 1, 8, 9, 2, 3, 4]
+p1 removeRef 8: QList: [size: 5; items: 1, 9, 2, 3, 4]
+p2 getLast: 4
+p2 current: 4
+p2 first: 6
+p2 last: 4
+p2 prev: 5
+p2 next: 4
+p2 prepend 9: QList: [size: 8; items: 9, 6, 0, 1, 2, 3, 5, 4]
+p1: QList: [size: 5; items: 1, 9, 2, 3, 4]
+p1 clear (autoDelete off): QList: [size: 0; items: ]
+p1 clear (autoDelete on): QList: [size: 0; items: ]
+p3 = p2: QList: [size: 8; items: 9, 6, 0, 1, 2, 3, 5, 4]
diff --git a/WebCore/src/kwq/tests/qt/qlist-test.cpp b/WebCore/src/kwq/tests/qt/qlist-test.cpp
index ce68b60..abe009b 100644
--- a/WebCore/src/kwq/tests/qt/qlist-test.cpp
+++ b/WebCore/src/kwq/tests/qt/qlist-test.cpp
@@ -8,7 +8,10 @@
int main() {
QList<int> p0;
-
+ QList<int> p1;
+ QList<int> p2;
+ QList<int> p3;
+
int i = 0;
int j = 1;
int k = 2;
@@ -16,30 +19,97 @@ int main() {
int m = 4;
int n = 5;
int o = 6;
+ int p = 7;
+ int q = 8;
+ int r = 9;
+ int s = 10;
- p0.append(&i);
- p0.append(&j);
- p0.append(&k);
- p0.append(&l);
- p0.append(&m);
- p0.append(&n);
- p0.append(&o);
-
- cout << p0 << endl;
+ p1.append(&i);
+ p1.append(&j);
+ p1.append(&k);
+ p1.append(&l);
+ p1.append(&m);
+ p1.append(&n);
+ p1.append(&o);
+
+ cout << "p0: " << p0 << endl;
+ cout << "p1: " << p1 << endl;
+
+ cout << "p0 isEmpty: " << p0.isEmpty() << endl;
+ cout << "p1 isEmpty: " << p1.isEmpty() << endl;
- cout << "finding index of 2: " << p0.find(&k) << endl;
+ cout << "p0 count: " << p0.count() << endl;
+ cout << "p1 count: " << p1.count() << endl;
+
+ cout << "p1 find index of 2: " << p1.find(&k) << endl;
- p0.removeFirst();
- cout << p0 << endl;
+ p1.removeFirst();
+ cout << "p1 removeFirst: " << p1 << endl;
- p0.removeLast();
- cout << p0 << endl;
+ p1.removeLast();
+ cout << "p1 removeLast: " << p1 << endl;
- cout << "taking last item: " << *(p0.take()) << endl;
- cout << p0 << endl;
+ cout << "p1 take: " << *(p1.take()) << " " << p1 << endl;
- cout << "contains 3: " << p0.containsRef(&l) << endl;
- cout << "contains 0: " << p0.containsRef(&i) << endl;
+ cout << "p1 containsRef 3: " << p1.containsRef(&l) << endl;
+ cout << "p1 containsRef 0: " << p1.containsRef(&i) << endl;
+
+ p2.append(&o);
+ p2.append(&n);
+ p2.append(&m);
+ p2.append(&l);
+ p2.append(&k);
+ p2.append(&j);
+ p2.append(&i);
+ cout << "p2 unsorted: " << p2 << endl;
+ p2.sort();
+ cout << "p2 sorted: " << p2 << endl; //heh?
+
+ int *n1;
+ n1 = p1.at(2);
+ cout << "p1 at 2: "<< *n1 << endl;
+
+ p1.insert(1, &p);
+ p1.insert(2, &q);
+ p1.insert(3, &r);
+ p1.insert(4, &s);
+ cout << "p1 insert 7 in 1: " << p1 << endl;
+
+ p1.remove();
+ cout << "p1 remove: " << p1 << endl;
+
+ p1.remove(&p);
+ cout << "p1 remove 7: " << p1 << endl;
+
+ p1.removeRef(&q);
+ cout << "p1 removeRef 8: " << p1 << endl;
+
+ int *n2;
+ n2 = p2.getLast();
+ cout << "p2 getLast: "<< *n2 << endl;
+ n2 = p2.current();
+ cout << "p2 current: "<< *n2 << endl;
+ n2 = p2.first();
+ cout << "p2 first: "<< *n2 << endl;
+ n2 = p2.last();
+ cout << "p2 last: "<< *n2 << endl;
+ n2 = p2.prev();
+ cout << "p2 prev: "<< *n2 << endl;
+ n2 = p2.next();
+ cout << "p2 next: "<< *n2 << endl;
+
+ p2.prepend(&r);
+ cout << "p2 prepend 9: "<< p2 << endl;
+
+ cout << "p1: "<< p1 << endl;
+ p1.setAutoDelete(FALSE);
+ p1.clear();
+ cout << "p1 clear (autoDelete off): "<< p1 << endl; // heh?
+ p1.setAutoDelete(TRUE);
+ p1.clear();
+ cout << "p1 clear (autoDelete on): "<< p1 << endl;
+ p3 = p2;
+ cout << "p3 = p2: "<< p3 << endl;
return 0;
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list