[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:31 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit bb6b287f4db9224930a0a3d76e7cf2893ee18ba2
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Sep 24 18:05:29 2001 +0000

    Added some more tests
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@178 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/kwq/tests/qt/Makefile.in b/WebCore/kwq/tests/qt/Makefile.in
index 638ab58..5504b77 100644
--- a/WebCore/kwq/tests/qt/Makefile.in
+++ b/WebCore/kwq/tests/qt/Makefile.in
@@ -23,10 +23,12 @@ PROGRAMS = \
     qpoint-test \
     qsize-test \
     qrect-test \
+    qarray-test \
     qmap-test \
     qvaluelist-test \
     qstringlist-test \
     qlist-test \
+    qregexp-test \
     $(NULL)
 
 CLEAN_FILES = *.o \
@@ -69,6 +71,9 @@ qrect-test: qrect-test.o
 qsize-test: qsize-test.o
 	$(CXX) -o $@ $< $(LDFLAGS)
 
+qarray-test: qarray-test.o
+	$(CXX) -o $@ $< $(LDFLAGS)
+
 qmap-test: qmap-test.o
 	$(CXX) -o $@ $< $(LDFLAGS)
 
@@ -81,6 +86,9 @@ qstringlist-test: qstringlist-test.o
 qlist-test: qlist-test.o
 	$(CXX) -o $@ $< $(LDFLAGS)
 
+qregexp-test: qregexp-test.o
+	$(CXX) -o $@ $< $(LDFLAGS)
+
 depend: 
 
 #----------------------------------------------------------------------
diff --git a/WebCore/kwq/tests/qt/qarray-test.chk b/WebCore/kwq/tests/qt/qarray-test.chk
new file mode 100644
index 0000000..8bfca21
Binary files /dev/null and b/WebCore/kwq/tests/qt/qarray-test.chk differ
diff --git a/WebCore/kwq/tests/qt/qarray-test.cpp b/WebCore/kwq/tests/qt/qarray-test.cpp
new file mode 100644
index 0000000..67886f4
--- /dev/null
+++ b/WebCore/kwq/tests/qt/qarray-test.cpp
@@ -0,0 +1,33 @@
+#include <iostream>
+
+#include <qarray.h>
+
+int main() {
+
+    QArray<char> a0 = QArray<char>(10);
+    QArray<char> a1 = QArray<char>(10);
+    QArray<char> a2 = QArray<char>(10);
+    QArray<char> a3;
+
+    char c = 'a';
+    for (int i = 0; i < 10; i++) {
+        a0[i] = c + i;
+    }
+
+    a1 = a0;
+    cout << "a0: " << a0 << endl;
+    cout << "a1: " << a1 << endl;
+    cout << "a2: " << a2 << endl;
+    cout << "a3: " << a3 << endl;
+
+    cout << "a0 == a1: " << (a0 == a1) << endl;
+    cout << "a0 == a2: " << (a0 == a2) << endl;
+
+    cout << "a2 is null: " << (a2.isNull()) << endl;
+    cout << "a2 is empty: " << (a2.isEmpty()) << endl;
+
+    cout << "a3 is null: " << (a3.isNull()) << endl;
+    cout << "a3 is empty: " << (a3.isEmpty()) << endl;
+
+    return 0;
+}
diff --git a/WebCore/kwq/tests/qt/qregexp-test.chk b/WebCore/kwq/tests/qt/qregexp-test.chk
new file mode 100644
index 0000000..00bf9ed
--- /dev/null
+++ b/WebCore/kwq/tests/qt/qregexp-test.chk
@@ -0,0 +1,8 @@
+abcdefghijklmnopqrstuvwxyz =~ ^ab: 0
+ABCDEFGHIJKLMNOPQRSTUVWXYZ =~ ^ab: -1
+abcdefghijklmnopqrstuvwxyz =~ def: 3
+ABCDEFGHIJKLMNOPQRSTUVWXYZ =~ def: -1
+abcdefghijklmnopqrstuvwxyz =~ [A-Z]: -1
+ABCDEFGHIJKLMNOPQRSTUVWXYZ =~ [A-Z]: 0
+AAABBBCCC =~ [A-Z]: 0
+AAABBBCCC =~ B+C: 3
diff --git a/WebCore/kwq/tests/qt/qregexp-test.cpp b/WebCore/kwq/tests/qt/qregexp-test.cpp
new file mode 100644
index 0000000..34f10cc
--- /dev/null
+++ b/WebCore/kwq/tests/qt/qregexp-test.cpp
@@ -0,0 +1,42 @@
+#include <iostream>
+
+#include <qstring.h>
+#include <qregexp.h>
+
+int main() {
+
+    QString s1 = "abcdefghijklmnopqrstuvwxyz";
+    QString s2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+    QString s3 = "AAABBBCCC";
+    
+    QRegExp r1 = QRegExp("^ab");    
+    QRegExp r2 = QRegExp("def");    
+    QRegExp r3 = QRegExp("[A-Z]");    
+    QRegExp r4 = QRegExp("B+C");    
+
+    cout << s1 << " =~ " << r1.pattern() << ": " 
+        << r1.match(s1) << endl;
+
+    cout << s2 << " =~ " << r1.pattern() << ": " 
+        << r1.match(s2) << endl;
+
+    cout << s1 << " =~ " << r2.pattern() << ": " 
+        << r2.match(s1) << endl;
+
+    cout << s2 << " =~ " << r2.pattern() << ": " 
+        << r2.match(s2) << endl;
+
+    cout << s1 << " =~ " << r3.pattern() << ": " 
+        << r3.match(s1) << endl;
+    
+    cout << s2 << " =~ " << r3.pattern() << ": " 
+        << r3.match(s2) << endl;
+    
+    cout << s3 << " =~ " << r3.pattern() << ": " 
+        << r3.match(s3) << endl;
+
+    cout << s3 << " =~ " << r4.pattern() << ": " 
+        << r4.match(s3) << endl;
+
+    return 0;
+}
diff --git a/WebCore/src/kwq/tests/qt/Makefile.in b/WebCore/src/kwq/tests/qt/Makefile.in
index 638ab58..5504b77 100644
--- a/WebCore/src/kwq/tests/qt/Makefile.in
+++ b/WebCore/src/kwq/tests/qt/Makefile.in
@@ -23,10 +23,12 @@ PROGRAMS = \
     qpoint-test \
     qsize-test \
     qrect-test \
+    qarray-test \
     qmap-test \
     qvaluelist-test \
     qstringlist-test \
     qlist-test \
+    qregexp-test \
     $(NULL)
 
 CLEAN_FILES = *.o \
@@ -69,6 +71,9 @@ qrect-test: qrect-test.o
 qsize-test: qsize-test.o
 	$(CXX) -o $@ $< $(LDFLAGS)
 
+qarray-test: qarray-test.o
+	$(CXX) -o $@ $< $(LDFLAGS)
+
 qmap-test: qmap-test.o
 	$(CXX) -o $@ $< $(LDFLAGS)
 
@@ -81,6 +86,9 @@ qstringlist-test: qstringlist-test.o
 qlist-test: qlist-test.o
 	$(CXX) -o $@ $< $(LDFLAGS)
 
+qregexp-test: qregexp-test.o
+	$(CXX) -o $@ $< $(LDFLAGS)
+
 depend: 
 
 #----------------------------------------------------------------------
diff --git a/WebCore/src/kwq/tests/qt/qarray-test.chk b/WebCore/src/kwq/tests/qt/qarray-test.chk
new file mode 100644
index 0000000..8bfca21
Binary files /dev/null and b/WebCore/src/kwq/tests/qt/qarray-test.chk differ
diff --git a/WebCore/src/kwq/tests/qt/qarray-test.cpp b/WebCore/src/kwq/tests/qt/qarray-test.cpp
new file mode 100644
index 0000000..67886f4
--- /dev/null
+++ b/WebCore/src/kwq/tests/qt/qarray-test.cpp
@@ -0,0 +1,33 @@
+#include <iostream>
+
+#include <qarray.h>
+
+int main() {
+
+    QArray<char> a0 = QArray<char>(10);
+    QArray<char> a1 = QArray<char>(10);
+    QArray<char> a2 = QArray<char>(10);
+    QArray<char> a3;
+
+    char c = 'a';
+    for (int i = 0; i < 10; i++) {
+        a0[i] = c + i;
+    }
+
+    a1 = a0;
+    cout << "a0: " << a0 << endl;
+    cout << "a1: " << a1 << endl;
+    cout << "a2: " << a2 << endl;
+    cout << "a3: " << a3 << endl;
+
+    cout << "a0 == a1: " << (a0 == a1) << endl;
+    cout << "a0 == a2: " << (a0 == a2) << endl;
+
+    cout << "a2 is null: " << (a2.isNull()) << endl;
+    cout << "a2 is empty: " << (a2.isEmpty()) << endl;
+
+    cout << "a3 is null: " << (a3.isNull()) << endl;
+    cout << "a3 is empty: " << (a3.isEmpty()) << endl;
+
+    return 0;
+}
diff --git a/WebCore/src/kwq/tests/qt/qregexp-test.chk b/WebCore/src/kwq/tests/qt/qregexp-test.chk
new file mode 100644
index 0000000..00bf9ed
--- /dev/null
+++ b/WebCore/src/kwq/tests/qt/qregexp-test.chk
@@ -0,0 +1,8 @@
+abcdefghijklmnopqrstuvwxyz =~ ^ab: 0
+ABCDEFGHIJKLMNOPQRSTUVWXYZ =~ ^ab: -1
+abcdefghijklmnopqrstuvwxyz =~ def: 3
+ABCDEFGHIJKLMNOPQRSTUVWXYZ =~ def: -1
+abcdefghijklmnopqrstuvwxyz =~ [A-Z]: -1
+ABCDEFGHIJKLMNOPQRSTUVWXYZ =~ [A-Z]: 0
+AAABBBCCC =~ [A-Z]: 0
+AAABBBCCC =~ B+C: 3
diff --git a/WebCore/src/kwq/tests/qt/qregexp-test.cpp b/WebCore/src/kwq/tests/qt/qregexp-test.cpp
new file mode 100644
index 0000000..34f10cc
--- /dev/null
+++ b/WebCore/src/kwq/tests/qt/qregexp-test.cpp
@@ -0,0 +1,42 @@
+#include <iostream>
+
+#include <qstring.h>
+#include <qregexp.h>
+
+int main() {
+
+    QString s1 = "abcdefghijklmnopqrstuvwxyz";
+    QString s2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+    QString s3 = "AAABBBCCC";
+    
+    QRegExp r1 = QRegExp("^ab");    
+    QRegExp r2 = QRegExp("def");    
+    QRegExp r3 = QRegExp("[A-Z]");    
+    QRegExp r4 = QRegExp("B+C");    
+
+    cout << s1 << " =~ " << r1.pattern() << ": " 
+        << r1.match(s1) << endl;
+
+    cout << s2 << " =~ " << r1.pattern() << ": " 
+        << r1.match(s2) << endl;
+
+    cout << s1 << " =~ " << r2.pattern() << ": " 
+        << r2.match(s1) << endl;
+
+    cout << s2 << " =~ " << r2.pattern() << ": " 
+        << r2.match(s2) << endl;
+
+    cout << s1 << " =~ " << r3.pattern() << ": " 
+        << r3.match(s1) << endl;
+    
+    cout << s2 << " =~ " << r3.pattern() << ": " 
+        << r3.match(s2) << endl;
+    
+    cout << s3 << " =~ " << r3.pattern() << ": " 
+        << r3.match(s3) << endl;
+
+    cout << s3 << " =~ " << r4.pattern() << ": " 
+        << r4.match(s3) << endl;
+
+    return 0;
+}

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list