[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
kocienda
kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:46:17 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit eeb910b765830c26eaf5caa355526a999c17ce23
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Sep 24 16:24:12 2001 +0000
Added some new tests
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/kwq/tests/qt/Makefile.in b/WebCore/kwq/tests/qt/Makefile.in
index 080be48..638ab58 100644
--- a/WebCore/kwq/tests/qt/Makefile.in
+++ b/WebCore/kwq/tests/qt/Makefile.in
@@ -24,6 +24,9 @@ PROGRAMS = \
qsize-test \
qrect-test \
qmap-test \
+ qvaluelist-test \
+ qstringlist-test \
+ qlist-test \
$(NULL)
CLEAN_FILES = *.o \
@@ -69,6 +72,15 @@ qsize-test: qsize-test.o
qmap-test: qmap-test.o
$(CXX) -o $@ $< $(LDFLAGS)
+qvaluelist-test: qvaluelist-test.o
+ $(CXX) -o $@ $< $(LDFLAGS)
+
+qstringlist-test: qstringlist-test.o
+ $(CXX) -o $@ $< $(LDFLAGS)
+
+qlist-test: qlist-test.o
+ $(CXX) -o $@ $< $(LDFLAGS)
+
depend:
#----------------------------------------------------------------------
diff --git a/WebCore/kwq/tests/qt/qlist-test.chk b/WebCore/kwq/tests/qt/qlist-test.chk
new file mode 100644
index 0000000..b5ac292
--- /dev/null
+++ b/WebCore/kwq/tests/qt/qlist-test.chk
@@ -0,0 +1,8 @@
+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
diff --git a/WebCore/kwq/tests/qt/qlist-test.cpp b/WebCore/kwq/tests/qt/qlist-test.cpp
new file mode 100644
index 0000000..ce68b60
--- /dev/null
+++ b/WebCore/kwq/tests/qt/qlist-test.cpp
@@ -0,0 +1,45 @@
+#include <iostream>
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <qlist.h>
+
+int main() {
+
+ QList<int> p0;
+
+ int i = 0;
+ int j = 1;
+ int k = 2;
+ int l = 3;
+ int m = 4;
+ int n = 5;
+ int o = 6;
+
+ p0.append(&i);
+ p0.append(&j);
+ p0.append(&k);
+ p0.append(&l);
+ p0.append(&m);
+ p0.append(&n);
+ p0.append(&o);
+
+ cout << p0 << endl;
+
+ cout << "finding index of 2: " << p0.find(&k) << endl;
+
+ p0.removeFirst();
+ cout << p0 << endl;
+
+ p0.removeLast();
+ cout << p0 << endl;
+
+ cout << "taking last item: " << *(p0.take()) << endl;
+ cout << p0 << endl;
+
+ cout << "contains 3: " << p0.containsRef(&l) << endl;
+ cout << "contains 0: " << p0.containsRef(&i) << endl;
+
+ return 0;
+}
diff --git a/WebCore/kwq/tests/qt/qstringlist-test.chk b/WebCore/kwq/tests/qt/qstringlist-test.chk
new file mode 100644
index 0000000..aea2e7c
--- /dev/null
+++ b/WebCore/kwq/tests/qt/qstringlist-test.chk
@@ -0,0 +1,5 @@
+QValueList: [size: 6; items: zero, one, two, three, four, five]
+three
+QValueList: [size: 8; items: zero, one, two, three, four, five, six, seven]
+three, four, five, six, seven
+QValueList: [size: 8; items: five, four, one, seven, six, three, two, zero]
diff --git a/WebCore/kwq/tests/qt/qstringlist-test.cpp b/WebCore/kwq/tests/qt/qstringlist-test.cpp
new file mode 100644
index 0000000..132a169
--- /dev/null
+++ b/WebCore/kwq/tests/qt/qstringlist-test.cpp
@@ -0,0 +1,36 @@
+#include <iostream>
+
+#include <qstring.h>
+#include <qstringlist.h>
+
+int main() {
+
+ QStringList p0;
+
+ p0.append("zero");
+ p0.append("one");
+ p0.append("two");
+ p0.append("three");
+ p0.append("four");
+ p0.append("five");
+
+ cout << p0 << endl;
+ cout << p0[3] << endl;
+ p0 += "six";
+ p0 += "seven";
+ cout << p0 << endl;
+
+ QValueListIterator<QString> it = p0.find("three");
+ while (it != p0.end()) {
+ cout << *it;
+ if (++it != p0.end()) {
+ cout << ", ";
+ }
+ }
+ cout << endl;
+
+ p0.sort();
+ cout << p0 << endl;
+
+ return 0;
+}
diff --git a/WebCore/kwq/tests/qt/qvaluelist-test.chk b/WebCore/kwq/tests/qt/qvaluelist-test.chk
new file mode 100644
index 0000000..21b8555
--- /dev/null
+++ b/WebCore/kwq/tests/qt/qvaluelist-test.chk
@@ -0,0 +1,4 @@
+QValueList: [size: 6; items: 0, 1, 2, 3, 4, 5]
+3
+QValueList: [size: 8; items: 0, 1, 2, 3, 4, 5, 6, 7]
+4, 5, 6, 7
diff --git a/WebCore/kwq/tests/qt/qvaluelist-test.cpp b/WebCore/kwq/tests/qt/qvaluelist-test.cpp
new file mode 100644
index 0000000..1ae999e
--- /dev/null
+++ b/WebCore/kwq/tests/qt/qvaluelist-test.cpp
@@ -0,0 +1,32 @@
+#include <iostream>
+
+#include <qvaluelist.h>
+
+int main() {
+
+ QValueList<int> p0;
+
+ p0.append(0);
+ p0.append(1);
+ p0.append(2);
+ p0.append(3);
+ p0.append(4);
+ p0.append(5);
+
+ cout << p0 << endl;
+ cout << p0[3] << endl;
+ p0 += 6;
+ p0 += 7;
+ cout << p0 << endl;
+
+ QValueListIterator<int> it = p0.find(4);
+ while (it != p0.end()) {
+ cout << *it;
+ if (++it != p0.end()) {
+ cout << ", ";
+ }
+ }
+ cout << endl;
+
+ return 0;
+}
diff --git a/WebCore/src/kwq/tests/qt/Makefile.in b/WebCore/src/kwq/tests/qt/Makefile.in
index 080be48..638ab58 100644
--- a/WebCore/src/kwq/tests/qt/Makefile.in
+++ b/WebCore/src/kwq/tests/qt/Makefile.in
@@ -24,6 +24,9 @@ PROGRAMS = \
qsize-test \
qrect-test \
qmap-test \
+ qvaluelist-test \
+ qstringlist-test \
+ qlist-test \
$(NULL)
CLEAN_FILES = *.o \
@@ -69,6 +72,15 @@ qsize-test: qsize-test.o
qmap-test: qmap-test.o
$(CXX) -o $@ $< $(LDFLAGS)
+qvaluelist-test: qvaluelist-test.o
+ $(CXX) -o $@ $< $(LDFLAGS)
+
+qstringlist-test: qstringlist-test.o
+ $(CXX) -o $@ $< $(LDFLAGS)
+
+qlist-test: qlist-test.o
+ $(CXX) -o $@ $< $(LDFLAGS)
+
depend:
#----------------------------------------------------------------------
diff --git a/WebCore/src/kwq/tests/qt/qlist-test.chk b/WebCore/src/kwq/tests/qt/qlist-test.chk
new file mode 100644
index 0000000..b5ac292
--- /dev/null
+++ b/WebCore/src/kwq/tests/qt/qlist-test.chk
@@ -0,0 +1,8 @@
+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
diff --git a/WebCore/src/kwq/tests/qt/qlist-test.cpp b/WebCore/src/kwq/tests/qt/qlist-test.cpp
new file mode 100644
index 0000000..ce68b60
--- /dev/null
+++ b/WebCore/src/kwq/tests/qt/qlist-test.cpp
@@ -0,0 +1,45 @@
+#include <iostream>
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <qlist.h>
+
+int main() {
+
+ QList<int> p0;
+
+ int i = 0;
+ int j = 1;
+ int k = 2;
+ int l = 3;
+ int m = 4;
+ int n = 5;
+ int o = 6;
+
+ p0.append(&i);
+ p0.append(&j);
+ p0.append(&k);
+ p0.append(&l);
+ p0.append(&m);
+ p0.append(&n);
+ p0.append(&o);
+
+ cout << p0 << endl;
+
+ cout << "finding index of 2: " << p0.find(&k) << endl;
+
+ p0.removeFirst();
+ cout << p0 << endl;
+
+ p0.removeLast();
+ cout << p0 << endl;
+
+ cout << "taking last item: " << *(p0.take()) << endl;
+ cout << p0 << endl;
+
+ cout << "contains 3: " << p0.containsRef(&l) << endl;
+ cout << "contains 0: " << p0.containsRef(&i) << endl;
+
+ return 0;
+}
diff --git a/WebCore/src/kwq/tests/qt/qstringlist-test.chk b/WebCore/src/kwq/tests/qt/qstringlist-test.chk
new file mode 100644
index 0000000..aea2e7c
--- /dev/null
+++ b/WebCore/src/kwq/tests/qt/qstringlist-test.chk
@@ -0,0 +1,5 @@
+QValueList: [size: 6; items: zero, one, two, three, four, five]
+three
+QValueList: [size: 8; items: zero, one, two, three, four, five, six, seven]
+three, four, five, six, seven
+QValueList: [size: 8; items: five, four, one, seven, six, three, two, zero]
diff --git a/WebCore/src/kwq/tests/qt/qstringlist-test.cpp b/WebCore/src/kwq/tests/qt/qstringlist-test.cpp
new file mode 100644
index 0000000..132a169
--- /dev/null
+++ b/WebCore/src/kwq/tests/qt/qstringlist-test.cpp
@@ -0,0 +1,36 @@
+#include <iostream>
+
+#include <qstring.h>
+#include <qstringlist.h>
+
+int main() {
+
+ QStringList p0;
+
+ p0.append("zero");
+ p0.append("one");
+ p0.append("two");
+ p0.append("three");
+ p0.append("four");
+ p0.append("five");
+
+ cout << p0 << endl;
+ cout << p0[3] << endl;
+ p0 += "six";
+ p0 += "seven";
+ cout << p0 << endl;
+
+ QValueListIterator<QString> it = p0.find("three");
+ while (it != p0.end()) {
+ cout << *it;
+ if (++it != p0.end()) {
+ cout << ", ";
+ }
+ }
+ cout << endl;
+
+ p0.sort();
+ cout << p0 << endl;
+
+ return 0;
+}
diff --git a/WebCore/src/kwq/tests/qt/qvaluelist-test.chk b/WebCore/src/kwq/tests/qt/qvaluelist-test.chk
new file mode 100644
index 0000000..21b8555
--- /dev/null
+++ b/WebCore/src/kwq/tests/qt/qvaluelist-test.chk
@@ -0,0 +1,4 @@
+QValueList: [size: 6; items: 0, 1, 2, 3, 4, 5]
+3
+QValueList: [size: 8; items: 0, 1, 2, 3, 4, 5, 6, 7]
+4, 5, 6, 7
diff --git a/WebCore/src/kwq/tests/qt/qvaluelist-test.cpp b/WebCore/src/kwq/tests/qt/qvaluelist-test.cpp
new file mode 100644
index 0000000..1ae999e
--- /dev/null
+++ b/WebCore/src/kwq/tests/qt/qvaluelist-test.cpp
@@ -0,0 +1,32 @@
+#include <iostream>
+
+#include <qvaluelist.h>
+
+int main() {
+
+ QValueList<int> p0;
+
+ p0.append(0);
+ p0.append(1);
+ p0.append(2);
+ p0.append(3);
+ p0.append(4);
+ p0.append(5);
+
+ cout << p0 << endl;
+ cout << p0[3] << endl;
+ p0 += 6;
+ p0 += 7;
+ cout << p0 << endl;
+
+ QValueListIterator<int> it = p0.find(4);
+ while (it != p0.end()) {
+ cout << *it;
+ if (++it != p0.end()) {
+ cout << ", ";
+ }
+ }
+ cout << endl;
+
+ return 0;
+}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list