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


The following commit has been merged in the debian/unstable branch:
commit d1d9ff97e0aebc6c8df2c361985a2a2fd1f14b04
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 27 22:05:53 2001 +0000

    Fixed the output for qstring-test.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@214 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/kwq/tests/qt/qstring-test.chk b/WebCore/kwq/tests/qt/qstring-test.chk
index 4b67a14..de5310c 100644
--- a/WebCore/kwq/tests/qt/qstring-test.chk
+++ b/WebCore/kwq/tests/qt/qstring-test.chk
@@ -1,104 +1,92 @@
-t
-t
-eeeee
-test
-this is a string
-test
-yet another string
-hello there
-e
-1
-0
-1
-0
-18
-this is 
-ttttt
-12
-2
-12
-12
-12
-7
-7
-12
-7
-7
-3
-3
-3
-3
-3
-blah
-blah
-blah
-blah....
-....blah
-Hello blah. How has your blah been?
-Hello  blah. How has your  blah been?
-Hello s. How has your s been?
-Hello Gramps. How has your morning been?
-Hello 22.45. How has your 22.45 been?
-Hello 356. How has your 23390082 been?
-Hello 3456. How has your 234234224 been?
-Hello 23409283. How has your 43242 been?
-this was a string in uppercase
-THIS WAS A STRING IN LOWERCASE
-This    was a  string   with a lot of       spaces
-This was a string with a lot of spaces
-221545
-221545
-221545
-221545
-24937
-221545
-221545
-24937
-This is a test. 44, 56.780000
-1
-0
-The answer is: 2
-The answer is: test2
-The answer is: Appletest2
-The answer is: cAppletest2
-The answer is: cAppletest22
-The answer is: cAppletest22c
-The answer is: cAppletest22cApple
-2The answer is: cAppletest22cApple
-c2The answer is: cAppletest22cApple
-Applec2The answer is: cAppletest22cApple
-The answer is: cAppletest22cApple
-There ere e lot of e's in e sentence such es this one
-Ttest ere e lot of e's in e sentence such es this one
-Ttest ere e bellof e's in e sentence such es this one
-22.45
-356
-356
-23390082
-3456
-234234224
-23409283
-43242
-223.234
-1
-0
-abcdef
-abcdefg
-abcdefghijk
-1
-0
-0
-0
-1
-0
-0
-0
-1
-1
-1
-1
-0
-0
-0
-1
-1
+s1: t
+s2: t
+s3: eeeee
+s4: test
+s5: this is a string
+s6: test
+s7: yet another string
+s8: hello there
+s9: e
+s0 isNull: 1
+s5 isNull: 0
+s11 isEmpty: 1
+s5 isEmpty: 0
+s7 length: 18
+s5 truncate 8: this is 
+s0 fill: ccccc
+s12: string
+s7 find "s": 12
+s7 find RegExp "t": 2
+s7 find s12: 12
+s7 find "string": 12
+s7 find "string": 12
+s7 findRev "t": 13
+s7 findRev "string": 12
+s13: blah blah blah
+s13 contains "b": 3
+s13 contains "blah": 3
+s13 left 4: blah
+s13 right 4: blah
+s13 mid 5-8: blah
+s15: Hello blah. How has your blah been?
+s15: Hello  blah. How has your  blah been?
+s15: Hello Gramps. How has your morning been?
+s15: Hello 22.45. How has your 22.45 been?
+s15: Hello 356. How has your 23390082 been?
+s15: Hello 3456. How has your 234234224 been?
+s15: Hello 23409283. How has your 43242 been?
+s16 lower: this was a string in uppercase
+s18 stripWhiteSpace: This    was a  string   with a lot of       spaces
+s18 simplifyWhiteSpace: This was a string with a lot of spaces
+s19: 221545
+s19: 221545
+s19: 221545
+s19: 221545
+s20: This is a test. 44, 56.780000
+s21: Apple Computer Inc.
+s22: Apple
+s23: MS
+s21 startsWith s22: 1
+s21 startsWith s23: 0
+s24: The answer is: 
+c2: 2
+s24 insert c2 at 15: The answer is: 2
+s24 append c2: The answer is: 22
+s24 append s22: The answer is: 22Apple
+s24 prepend c2: 2The answer is: 22Apple
+s24 prepend s22: Apple2The answer is: 22Apple
+s24 remove 0-7: he answer is: 22Apple
+s25 replace RegExp "a" with "e": There ere e lot of e's in e sentence such es this one
+s27: 22.45
+s27: 356
+s27: 356
+s27: 23390082
+s27: 3456
+s27: 234234224
+s27: 23409283
+s27: 43242
+s27: 223.234
+s28 !: 1
+s29 !: 0
+s30: abcde
+c3: f
+ch2: g
+s31: hijk
+s30 += c3: abcdef
+s30 += ch2: abcdefg
+s30 += s31: abcdefghijk
+s33: This is a string
+s34: This is a longer string
+ch3: This is an even longer string
+c4: T
+s33 == ch3: 0
+c3 == s33: 0
+s33 == s34: 0
+s33 == c4: 0
+s33 != ch3: 1
+c3 != s33: 1
+s33 != s34: 1
+s33 != c4: 1
+ch3 + s33: This is an even longer stringThis is a string
+c4 + s33: TThis is a string
+'a' + s33: aThis is a string
diff --git a/WebCore/kwq/tests/qt/qstring-test.cpp b/WebCore/kwq/tests/qt/qstring-test.cpp
index 71fc3eb..87544e3 100644
--- a/WebCore/kwq/tests/qt/qstring-test.cpp
+++ b/WebCore/kwq/tests/qt/qstring-test.cpp
@@ -31,62 +31,58 @@ int main() {
     QString s9 = c[1];
     //QString s10 = ch;
     
-    cout << s1 << endl;
-    cout << s2 << endl;
-    cout << s3 << endl;
-    cout << s4 << endl;
-    cout << s5 << endl;
-    cout << s6 << endl;
-    cout << s7 << endl;
-    cout << s8 << endl;
-    cout << s9 << endl;
-    //cout << s10 << endl;
+    cout << "s1: " << s1 << endl;
+    cout << "s2: " << s2 << endl;
+    cout << "s3: " << s3 << endl;
+    cout << "s4: " << s4 << endl;
+    cout << "s5: " << s5 << endl;
+    cout << "s6: " << s6 << endl;
+    cout << "s7: " << s7 << endl;
+    cout << "s8: " << s8 << endl;
+    cout << "s9: " << s9 << endl;
+    //cout << "s10: " << s10 << endl;
     
     QString s11 = QString(""); // make an empty string
     
-    cout << s0.isNull() << endl;
-    cout << s5.isNull() << endl;
-    cout << s11.isEmpty() << endl;
-    cout << s5.isEmpty() << endl;
-    cout << s7.length() << endl;
+    cout << "s0 isNull: " << s0.isNull() << endl;
+    cout << "s5 isNull: " << s5.isNull() << endl;
+    cout << "s11 isEmpty: " << s11.isEmpty() << endl;
+    cout << "s5 isEmpty: " << s5.isEmpty() << endl;
+    cout << "s7 length: " << s7.length() << endl;
     
     s5.truncate(8);
-    cout << s5 << endl;
+    cout << "s5 truncate 8: " << s5 << endl;
     
-    s0.fill(c[3], 5);
-    cout << s0 << endl;
+    s0.fill('c', 5);
+    cout << "s0 fill: " << s0 << endl;
     
     QRegExp qre = QRegExp(s1, TRUE, FALSE);
     QString s12 = QString("string");
-    QString s13 = QString("blah blah blah");
-    QString s14 = QString("blah");
-    char blah[4];
-    strcpy(blah, "blah");
-    
-    cout << s7.find(c[2], 0, FALSE) << endl; // find functions
-    cout << s7.find(qre, 0) << endl;
-    cout << s7.find(s12, 0, TRUE) << endl;
-    cout << s7.find("string", 0) << endl;
-    cout << s7.find("string", 0, TRUE) << endl;
-    //cout << s7.findRev(c[0], 10, TRUE) << endl;
+    cout << "s12: " << s12 << endl;
+    cout << "s7 find \"s\": " << s7.find('s', 0, FALSE) << endl; // find functions
+    cout << "s7 find RegExp \"t\": " << s7.find(qre, 0) << endl;
+    cout << "s7 find s12: " << s7.find(s12, 0, TRUE) << endl;
+    cout << "s7 find \"string\": " << s7.find("string", 0) << endl;
+    cout << "s7 find \"string\": " << s7.find("string", 0, TRUE) << endl;
+    cout << "s7 findRev \"t\": " << s7.findRev('t', s7.length()) << endl;
+    cout << "s7 findRev \"string\": " << s7.findRev("string", s7.length()) << endl;
     //cout << s7.findRev(qre, 10) << endl;
     //cout << s7.findRev(s12, -1, TRUE) << endl;
-    //cout << s7.findRev('t', 10) << endl;
     //cout << s7.findRev('t', 10, TRUE) << endl;
     
+    QString s13 = QString("blah blah blah");
+    cout << "s13: " << s13 << endl;
+    cout << "s13 contains \"b\": " << s13.contains('b') << endl;
+    cout << "s13 contains \"blah\": " << s13.contains("blah", TRUE) << endl;
     //cout << s7.contains(c[0], TRUE) << endl;
     //cout << s7.contains(qre) << endl;
-    cout << s13.contains(s14, TRUE) << endl;
     //cout << s13.contains('b', TRUE) << endl;
-    cout << s13.contains(blah, TRUE) << endl;
     
-    cout << s13.left(4) << endl;
-    cout << s13.right(4) << endl;
-    cout << s13.mid(5,4) << endl;
-    //cout << s14.leftJustify(8,'.') << endl;
-    //cout << s14.rightJustify(8,'.') << endl;
+    cout << "s13 left 4: " << s13.left(4) << endl;
+    cout << "s13 right 4: " << s13.right(4) << endl;
+    cout << "s13 mid 5-8: " << s13.mid(5,4) << endl;
+
     
-    QString s15 = "Hello %1. How has your %2 been?";
     double my_double =22.45;
     int my_int = 356;
     long my_long = 23390082;
@@ -95,114 +91,133 @@ int main() {
     ulong my_ulong = 23409283;
     ushort my_ushort = 43242;
     float my_float = 223.2342;
-    
-    cout << s15.arg(s14).arg(s14) << endl;
-    cout << s15.arg(s14, 5).arg(s14, 5) << endl; // fieldwidth only add one extra space. hmmmm.
-    //cout << s15.arg(c[2]).arg(c[2]) << endl;
-    cout << s15.arg("Gramps").arg("morning") << endl;
-    cout << s15.arg(my_double).arg(my_double) << endl;
-    cout << s15.arg(my_int).arg(my_long) << endl;
-    cout << s15.arg(my_short).arg(my_unit) << endl;
-    cout << s15.arg(my_ulong).arg(my_ushort) << endl;
+    QString s14 = QString("blah");
+    QString s15 = "Hello %1. How has your %2 been?";
+    cout << "s15: " << s15.arg(s14).arg(s14) << endl;
+    cout << "s15: " << s15.arg(s14, 5).arg(s14, 5) << endl; // fieldwidth only add one extra space. hmmmm.
+    cout << "s15: " << s15.arg("Gramps").arg("morning") << endl;
+    cout << "s15: " << s15.arg(my_double).arg(my_double) << endl;
+    cout << "s15: " << s15.arg(my_int).arg(my_long) << endl;
+    cout << "s15: " << s15.arg(my_short).arg(my_unit) << endl;
+    cout << "s15: " << s15.arg(my_ulong).arg(my_ushort) << endl;
+    //cout << "s15: " << s15.arg(c[2]).arg(c[2]) << endl;
     
     QString s16 = "THIS WAS A STRING IN UPPERCASE";
     QString s17 = "this was a string in lowercase";
-    cout << s16.lower() << endl;
-    //cout << s17.upper() << endl;
+    cout << "s16 lower: " << s16.lower() << endl;
+    //cout << "s17 upper: " << s17.upper() << endl;
     
     QString s18 =" This    was a  string   with a lot of       spaces ";
-    cout << s18.stripWhiteSpace() << endl; //why is white space still there?
-    cout << s18.simplifyWhiteSpace() << endl; //this works
+    cout << "s18 stripWhiteSpace: " << s18.stripWhiteSpace() << endl;
+    cout << "s18 simplifyWhiteSpace: " << s18.simplifyWhiteSpace() << endl;
     
     QString s19 = "221545";
+    cout << "s19: " << s19.toFloat() << endl;
+    cout << "s19: " << s19.toInt() << endl;
+    cout << "s19: " << s19.toLong() << endl;
+    cout << "s19: " << s19.toUInt() << endl;
     //cout << s19.toDouble() << endl;   //Am I properly testing this?
-    cout << s19.toFloat() << endl;
-    cout << s19.toInt() << endl;
-    cout << s19.toLong() << endl;
     //cout << s19.toShort() << endl;
-    cout << s19.toUInt() << endl;
     //cout << s19.toULong() << endl;
     //cout << s19.toUShort() << endl;
     
     QString s20;
-    cout << s20.sprintf("This is a %s. %d, %f", "test", 44, 56.78) << endl;
+    cout << "s20: " << s20.sprintf("This is a %s. %d, %f", "test", 44, 56.78) << endl;
 
     QString s21 = "Apple Computer Inc.";
     QString s22 = "Apple";
     QString s23 = "MS";
-    cout << s21.startsWith(s22) << endl;
-    cout << s21.startsWith(s23) << endl;
+    cout << "s21: " << s21 << endl;
+    cout << "s22: " << s22 << endl;
+    cout << "s23: " << s23 << endl;
+    cout << "s21 startsWith s22: " << s21.startsWith(s22) << endl;
+    cout << "s21 startsWith s23: " << s21.startsWith(s23) << endl;
     
     QString s24 = "The answer is: ";
     QChar c2 = '2';
-    cout << s24.insert(15, c2) << endl;
+    cout << "s24: " << s24 << endl;
+    cout << "c2: " << c2 << endl;
+    cout << "s24 insert c2 at 15: " << s24.insert(15, c2) << endl;
+    cout << "s24 append c2: " << s24.append(c2) << endl;
+    cout << "s24 append s22: " << s24.append(s22) << endl;    
+    cout << "s24 prepend c2: " << s24.prepend(c2) << endl;
+    cout << "s24 prepend s22: " << s24.prepend(s22) << endl;
+    cout << "s24 remove 0-7: " << s24.remove(0, 7) << endl;
     //cout << s24.insert(15, c, 4) << endl;
     //cout << s24.insert(15, s22) << endl;
     //cout << s24.insert(15, 'c') << endl;
-    cout << s24.append(c2) << endl;
     //cout << s24.append('c') << endl;
-    cout << s24.append(s22) << endl;    
-    cout << s24.prepend(c2) << endl;
     //cout << s24.prepend('c') << endl;
-    cout << s24.prepend(s22) << endl;
-    cout << s24.remove(0, 7) << endl;
     
     QString s25 = "There are a lot of a's in a sentence such as this one";
-    QString s26 = "bell";
-    cout << s25.replace( QRegExp("a"), "e" ) << endl; 
+    cout << "s25 replace RegExp \"a\" with \"e\": " << s25.replace( QRegExp("a"), "e" ) << endl; 
     //cout << s25.replace(1, 4, c, 4) << endl;
-    //cout << s25.replace(12, 4, s26) << endl;
+
     
     QString s27;
-    cout << s27.setNum(my_double) << endl;
-    cout << s27.setNum(my_int) << endl;
-    cout << s27.setNum(my_int) << endl;
-    cout << s27.setNum(my_long) << endl;
-    cout << s27.setNum(my_short) << endl;
-    cout << s27.setNum(my_unit) << endl;
-    cout << s27.setNum(my_ulong) << endl;
-    cout << s27.setNum(my_ushort) << endl;
-    cout << s27.setNum(my_float) << endl;
+    cout << "s27: " << s27.setNum(my_double) << endl;
+    cout << "s27: " << s27.setNum(my_int) << endl;
+    cout << "s27: " << s27.setNum(my_int) << endl;
+    cout << "s27: " << s27.setNum(my_long) << endl;
+    cout << "s27: " << s27.setNum(my_short) << endl;
+    cout << "s27: " << s27.setNum(my_unit) << endl;
+    cout << "s27: " << s27.setNum(my_ulong) << endl;
+    cout << "s27: " << s27.setNum(my_ushort) << endl;
+    cout << "s27: " << s27.setNum(my_float) << endl;
     
     QString s28;
     QString s29 = "a string that is a little long";
-    cout << !s28 << endl;
-    cout << !s29 << endl;
+    cout << "s28 !: " << !s28 << endl;
+    cout << "s29 !: " << !s29 << endl;
     
     QString s30 = "abcde";
     QChar c3='f';
-    QChar ch2='g';
+    char ch2='g';
     QString s31 = "hijk";
-    cout << (s30 += c3) << endl;
-    cout << (s30 += ch2) << endl;
-    cout << (s30 += s31) << endl;
+    cout << "s30: " << s30 << endl;
+    cout << "c3: " << c3 << endl;
+    cout << "ch2: " << ch2 << endl;
+    cout << "s31: " << s31 << endl;
+    cout << "s30 += c3: " << (s30 += c3) << endl;
+    cout << "s30 += ch2: " << (s30 += ch2) << endl;
+    cout << "s30 += s31: " << (s30 += s31) << endl;
     
     
     // test operators
     
     QString s33 = "This is a string";
     QString s34 = "This is a longer string";
-    char c4[25];
-    strcpy(c4, "This is an even longer string");
-    cout << (s33 < c4) << endl;
-    cout << (c4 < s33) << endl;
-    cout << (s33 < s34) << endl;
-    cout << (s33 > c4) << endl;
-    //cout << (c4 > s33) << endl; //compiler says this is not a supported function. 
-                                  //Documentation says bool operator> (const char * s1, const QString & s2) 
-    cout << (s33 > s34) << endl;
-    cout << (s33 == c4) << endl;
-    cout << (c4 == s33) << endl;
-    cout << (s33 == s34) << endl;
-    cout << (s33 != c4) << endl;
-    cout << (c4 != s33) << endl;
-    cout << (s33 != s34) << endl;    
-    cout << (s33 <= c4) << endl;
-    cout << (c4 <= s33) << endl;
-    cout << (s33 <= s34) << endl;
-    cout << (s33 >= c4) << endl;
-    cout << (c4 >= s33) << endl;
-    cout << (s33 >= s34) << endl;
+    char ch3[30];
+    strcpy(ch3, "This is an even longer string");
+    QChar c4 ='T';
+    cout << "s33: " << s33 << endl;
+    cout << "s34: " << s34 << endl;
+    cout << "ch3: " << ch3 << endl;
+    cout << "c4: " << c4 << endl;
+    cout << "s33 == ch3: " << (s33 == ch3) << endl;   // I should test strings that are equal as well
+    cout << "c3 == s33: "<< (c4 == s33) << endl;
+    cout << "s33 == s34: "<< (s33 == s34) << endl;
+    cout << "s33 == c4: "<< (s33 == c4) << endl;
+    cout << "s33 != ch3: " << (s33 != ch3) << endl;
+    cout << "c3 != s33: "<< (c4 != s33) << endl;
+    cout << "s33 != s34: "<< (s33 != s34) << endl;
+    cout << "s33 != c4: "<< (s33 != c4) << endl; 
+    cout << "ch3 + s33: " << (ch3 + s33) << endl;
+    cout << "c4 + s33: " << (c4 + s33) << endl;
+    cout << "\'a\' + s33: " << ('a' + s33) << endl;
+    
+    //cout << (s33 < c4) << endl;
+    //cout << (c4 < s33) << endl;
+    //cout << (s33 < s34) << endl;
+    //cout << (s33 > c4) << endl;
+    //cout << (c4 > s33) << endl;
+    //cout << (s33 > s34) << endl;   
+    //cout << (s33 <= c4) << endl;
+    //cout << (c4 <= s33) << endl;
+    //cout << (s33 <= s34) << endl;
+    //cout << (s33 >= c4) << endl;
+    //cout << (c4 >= s33) << endl;
+    //cout << (s33 >= s34) << endl;
     
     
         
diff --git a/WebCore/src/kwq/tests/qt/qstring-test.chk b/WebCore/src/kwq/tests/qt/qstring-test.chk
index 4b67a14..de5310c 100644
--- a/WebCore/src/kwq/tests/qt/qstring-test.chk
+++ b/WebCore/src/kwq/tests/qt/qstring-test.chk
@@ -1,104 +1,92 @@
-t
-t
-eeeee
-test
-this is a string
-test
-yet another string
-hello there
-e
-1
-0
-1
-0
-18
-this is 
-ttttt
-12
-2
-12
-12
-12
-7
-7
-12
-7
-7
-3
-3
-3
-3
-3
-blah
-blah
-blah
-blah....
-....blah
-Hello blah. How has your blah been?
-Hello  blah. How has your  blah been?
-Hello s. How has your s been?
-Hello Gramps. How has your morning been?
-Hello 22.45. How has your 22.45 been?
-Hello 356. How has your 23390082 been?
-Hello 3456. How has your 234234224 been?
-Hello 23409283. How has your 43242 been?
-this was a string in uppercase
-THIS WAS A STRING IN LOWERCASE
-This    was a  string   with a lot of       spaces
-This was a string with a lot of spaces
-221545
-221545
-221545
-221545
-24937
-221545
-221545
-24937
-This is a test. 44, 56.780000
-1
-0
-The answer is: 2
-The answer is: test2
-The answer is: Appletest2
-The answer is: cAppletest2
-The answer is: cAppletest22
-The answer is: cAppletest22c
-The answer is: cAppletest22cApple
-2The answer is: cAppletest22cApple
-c2The answer is: cAppletest22cApple
-Applec2The answer is: cAppletest22cApple
-The answer is: cAppletest22cApple
-There ere e lot of e's in e sentence such es this one
-Ttest ere e lot of e's in e sentence such es this one
-Ttest ere e bellof e's in e sentence such es this one
-22.45
-356
-356
-23390082
-3456
-234234224
-23409283
-43242
-223.234
-1
-0
-abcdef
-abcdefg
-abcdefghijk
-1
-0
-0
-0
-1
-0
-0
-0
-1
-1
-1
-1
-0
-0
-0
-1
-1
+s1: t
+s2: t
+s3: eeeee
+s4: test
+s5: this is a string
+s6: test
+s7: yet another string
+s8: hello there
+s9: e
+s0 isNull: 1
+s5 isNull: 0
+s11 isEmpty: 1
+s5 isEmpty: 0
+s7 length: 18
+s5 truncate 8: this is 
+s0 fill: ccccc
+s12: string
+s7 find "s": 12
+s7 find RegExp "t": 2
+s7 find s12: 12
+s7 find "string": 12
+s7 find "string": 12
+s7 findRev "t": 13
+s7 findRev "string": 12
+s13: blah blah blah
+s13 contains "b": 3
+s13 contains "blah": 3
+s13 left 4: blah
+s13 right 4: blah
+s13 mid 5-8: blah
+s15: Hello blah. How has your blah been?
+s15: Hello  blah. How has your  blah been?
+s15: Hello Gramps. How has your morning been?
+s15: Hello 22.45. How has your 22.45 been?
+s15: Hello 356. How has your 23390082 been?
+s15: Hello 3456. How has your 234234224 been?
+s15: Hello 23409283. How has your 43242 been?
+s16 lower: this was a string in uppercase
+s18 stripWhiteSpace: This    was a  string   with a lot of       spaces
+s18 simplifyWhiteSpace: This was a string with a lot of spaces
+s19: 221545
+s19: 221545
+s19: 221545
+s19: 221545
+s20: This is a test. 44, 56.780000
+s21: Apple Computer Inc.
+s22: Apple
+s23: MS
+s21 startsWith s22: 1
+s21 startsWith s23: 0
+s24: The answer is: 
+c2: 2
+s24 insert c2 at 15: The answer is: 2
+s24 append c2: The answer is: 22
+s24 append s22: The answer is: 22Apple
+s24 prepend c2: 2The answer is: 22Apple
+s24 prepend s22: Apple2The answer is: 22Apple
+s24 remove 0-7: he answer is: 22Apple
+s25 replace RegExp "a" with "e": There ere e lot of e's in e sentence such es this one
+s27: 22.45
+s27: 356
+s27: 356
+s27: 23390082
+s27: 3456
+s27: 234234224
+s27: 23409283
+s27: 43242
+s27: 223.234
+s28 !: 1
+s29 !: 0
+s30: abcde
+c3: f
+ch2: g
+s31: hijk
+s30 += c3: abcdef
+s30 += ch2: abcdefg
+s30 += s31: abcdefghijk
+s33: This is a string
+s34: This is a longer string
+ch3: This is an even longer string
+c4: T
+s33 == ch3: 0
+c3 == s33: 0
+s33 == s34: 0
+s33 == c4: 0
+s33 != ch3: 1
+c3 != s33: 1
+s33 != s34: 1
+s33 != c4: 1
+ch3 + s33: This is an even longer stringThis is a string
+c4 + s33: TThis is a string
+'a' + s33: aThis is a string
diff --git a/WebCore/src/kwq/tests/qt/qstring-test.cpp b/WebCore/src/kwq/tests/qt/qstring-test.cpp
index 71fc3eb..87544e3 100644
--- a/WebCore/src/kwq/tests/qt/qstring-test.cpp
+++ b/WebCore/src/kwq/tests/qt/qstring-test.cpp
@@ -31,62 +31,58 @@ int main() {
     QString s9 = c[1];
     //QString s10 = ch;
     
-    cout << s1 << endl;
-    cout << s2 << endl;
-    cout << s3 << endl;
-    cout << s4 << endl;
-    cout << s5 << endl;
-    cout << s6 << endl;
-    cout << s7 << endl;
-    cout << s8 << endl;
-    cout << s9 << endl;
-    //cout << s10 << endl;
+    cout << "s1: " << s1 << endl;
+    cout << "s2: " << s2 << endl;
+    cout << "s3: " << s3 << endl;
+    cout << "s4: " << s4 << endl;
+    cout << "s5: " << s5 << endl;
+    cout << "s6: " << s6 << endl;
+    cout << "s7: " << s7 << endl;
+    cout << "s8: " << s8 << endl;
+    cout << "s9: " << s9 << endl;
+    //cout << "s10: " << s10 << endl;
     
     QString s11 = QString(""); // make an empty string
     
-    cout << s0.isNull() << endl;
-    cout << s5.isNull() << endl;
-    cout << s11.isEmpty() << endl;
-    cout << s5.isEmpty() << endl;
-    cout << s7.length() << endl;
+    cout << "s0 isNull: " << s0.isNull() << endl;
+    cout << "s5 isNull: " << s5.isNull() << endl;
+    cout << "s11 isEmpty: " << s11.isEmpty() << endl;
+    cout << "s5 isEmpty: " << s5.isEmpty() << endl;
+    cout << "s7 length: " << s7.length() << endl;
     
     s5.truncate(8);
-    cout << s5 << endl;
+    cout << "s5 truncate 8: " << s5 << endl;
     
-    s0.fill(c[3], 5);
-    cout << s0 << endl;
+    s0.fill('c', 5);
+    cout << "s0 fill: " << s0 << endl;
     
     QRegExp qre = QRegExp(s1, TRUE, FALSE);
     QString s12 = QString("string");
-    QString s13 = QString("blah blah blah");
-    QString s14 = QString("blah");
-    char blah[4];
-    strcpy(blah, "blah");
-    
-    cout << s7.find(c[2], 0, FALSE) << endl; // find functions
-    cout << s7.find(qre, 0) << endl;
-    cout << s7.find(s12, 0, TRUE) << endl;
-    cout << s7.find("string", 0) << endl;
-    cout << s7.find("string", 0, TRUE) << endl;
-    //cout << s7.findRev(c[0], 10, TRUE) << endl;
+    cout << "s12: " << s12 << endl;
+    cout << "s7 find \"s\": " << s7.find('s', 0, FALSE) << endl; // find functions
+    cout << "s7 find RegExp \"t\": " << s7.find(qre, 0) << endl;
+    cout << "s7 find s12: " << s7.find(s12, 0, TRUE) << endl;
+    cout << "s7 find \"string\": " << s7.find("string", 0) << endl;
+    cout << "s7 find \"string\": " << s7.find("string", 0, TRUE) << endl;
+    cout << "s7 findRev \"t\": " << s7.findRev('t', s7.length()) << endl;
+    cout << "s7 findRev \"string\": " << s7.findRev("string", s7.length()) << endl;
     //cout << s7.findRev(qre, 10) << endl;
     //cout << s7.findRev(s12, -1, TRUE) << endl;
-    //cout << s7.findRev('t', 10) << endl;
     //cout << s7.findRev('t', 10, TRUE) << endl;
     
+    QString s13 = QString("blah blah blah");
+    cout << "s13: " << s13 << endl;
+    cout << "s13 contains \"b\": " << s13.contains('b') << endl;
+    cout << "s13 contains \"blah\": " << s13.contains("blah", TRUE) << endl;
     //cout << s7.contains(c[0], TRUE) << endl;
     //cout << s7.contains(qre) << endl;
-    cout << s13.contains(s14, TRUE) << endl;
     //cout << s13.contains('b', TRUE) << endl;
-    cout << s13.contains(blah, TRUE) << endl;
     
-    cout << s13.left(4) << endl;
-    cout << s13.right(4) << endl;
-    cout << s13.mid(5,4) << endl;
-    //cout << s14.leftJustify(8,'.') << endl;
-    //cout << s14.rightJustify(8,'.') << endl;
+    cout << "s13 left 4: " << s13.left(4) << endl;
+    cout << "s13 right 4: " << s13.right(4) << endl;
+    cout << "s13 mid 5-8: " << s13.mid(5,4) << endl;
+
     
-    QString s15 = "Hello %1. How has your %2 been?";
     double my_double =22.45;
     int my_int = 356;
     long my_long = 23390082;
@@ -95,114 +91,133 @@ int main() {
     ulong my_ulong = 23409283;
     ushort my_ushort = 43242;
     float my_float = 223.2342;
-    
-    cout << s15.arg(s14).arg(s14) << endl;
-    cout << s15.arg(s14, 5).arg(s14, 5) << endl; // fieldwidth only add one extra space. hmmmm.
-    //cout << s15.arg(c[2]).arg(c[2]) << endl;
-    cout << s15.arg("Gramps").arg("morning") << endl;
-    cout << s15.arg(my_double).arg(my_double) << endl;
-    cout << s15.arg(my_int).arg(my_long) << endl;
-    cout << s15.arg(my_short).arg(my_unit) << endl;
-    cout << s15.arg(my_ulong).arg(my_ushort) << endl;
+    QString s14 = QString("blah");
+    QString s15 = "Hello %1. How has your %2 been?";
+    cout << "s15: " << s15.arg(s14).arg(s14) << endl;
+    cout << "s15: " << s15.arg(s14, 5).arg(s14, 5) << endl; // fieldwidth only add one extra space. hmmmm.
+    cout << "s15: " << s15.arg("Gramps").arg("morning") << endl;
+    cout << "s15: " << s15.arg(my_double).arg(my_double) << endl;
+    cout << "s15: " << s15.arg(my_int).arg(my_long) << endl;
+    cout << "s15: " << s15.arg(my_short).arg(my_unit) << endl;
+    cout << "s15: " << s15.arg(my_ulong).arg(my_ushort) << endl;
+    //cout << "s15: " << s15.arg(c[2]).arg(c[2]) << endl;
     
     QString s16 = "THIS WAS A STRING IN UPPERCASE";
     QString s17 = "this was a string in lowercase";
-    cout << s16.lower() << endl;
-    //cout << s17.upper() << endl;
+    cout << "s16 lower: " << s16.lower() << endl;
+    //cout << "s17 upper: " << s17.upper() << endl;
     
     QString s18 =" This    was a  string   with a lot of       spaces ";
-    cout << s18.stripWhiteSpace() << endl; //why is white space still there?
-    cout << s18.simplifyWhiteSpace() << endl; //this works
+    cout << "s18 stripWhiteSpace: " << s18.stripWhiteSpace() << endl;
+    cout << "s18 simplifyWhiteSpace: " << s18.simplifyWhiteSpace() << endl;
     
     QString s19 = "221545";
+    cout << "s19: " << s19.toFloat() << endl;
+    cout << "s19: " << s19.toInt() << endl;
+    cout << "s19: " << s19.toLong() << endl;
+    cout << "s19: " << s19.toUInt() << endl;
     //cout << s19.toDouble() << endl;   //Am I properly testing this?
-    cout << s19.toFloat() << endl;
-    cout << s19.toInt() << endl;
-    cout << s19.toLong() << endl;
     //cout << s19.toShort() << endl;
-    cout << s19.toUInt() << endl;
     //cout << s19.toULong() << endl;
     //cout << s19.toUShort() << endl;
     
     QString s20;
-    cout << s20.sprintf("This is a %s. %d, %f", "test", 44, 56.78) << endl;
+    cout << "s20: " << s20.sprintf("This is a %s. %d, %f", "test", 44, 56.78) << endl;
 
     QString s21 = "Apple Computer Inc.";
     QString s22 = "Apple";
     QString s23 = "MS";
-    cout << s21.startsWith(s22) << endl;
-    cout << s21.startsWith(s23) << endl;
+    cout << "s21: " << s21 << endl;
+    cout << "s22: " << s22 << endl;
+    cout << "s23: " << s23 << endl;
+    cout << "s21 startsWith s22: " << s21.startsWith(s22) << endl;
+    cout << "s21 startsWith s23: " << s21.startsWith(s23) << endl;
     
     QString s24 = "The answer is: ";
     QChar c2 = '2';
-    cout << s24.insert(15, c2) << endl;
+    cout << "s24: " << s24 << endl;
+    cout << "c2: " << c2 << endl;
+    cout << "s24 insert c2 at 15: " << s24.insert(15, c2) << endl;
+    cout << "s24 append c2: " << s24.append(c2) << endl;
+    cout << "s24 append s22: " << s24.append(s22) << endl;    
+    cout << "s24 prepend c2: " << s24.prepend(c2) << endl;
+    cout << "s24 prepend s22: " << s24.prepend(s22) << endl;
+    cout << "s24 remove 0-7: " << s24.remove(0, 7) << endl;
     //cout << s24.insert(15, c, 4) << endl;
     //cout << s24.insert(15, s22) << endl;
     //cout << s24.insert(15, 'c') << endl;
-    cout << s24.append(c2) << endl;
     //cout << s24.append('c') << endl;
-    cout << s24.append(s22) << endl;    
-    cout << s24.prepend(c2) << endl;
     //cout << s24.prepend('c') << endl;
-    cout << s24.prepend(s22) << endl;
-    cout << s24.remove(0, 7) << endl;
     
     QString s25 = "There are a lot of a's in a sentence such as this one";
-    QString s26 = "bell";
-    cout << s25.replace( QRegExp("a"), "e" ) << endl; 
+    cout << "s25 replace RegExp \"a\" with \"e\": " << s25.replace( QRegExp("a"), "e" ) << endl; 
     //cout << s25.replace(1, 4, c, 4) << endl;
-    //cout << s25.replace(12, 4, s26) << endl;
+
     
     QString s27;
-    cout << s27.setNum(my_double) << endl;
-    cout << s27.setNum(my_int) << endl;
-    cout << s27.setNum(my_int) << endl;
-    cout << s27.setNum(my_long) << endl;
-    cout << s27.setNum(my_short) << endl;
-    cout << s27.setNum(my_unit) << endl;
-    cout << s27.setNum(my_ulong) << endl;
-    cout << s27.setNum(my_ushort) << endl;
-    cout << s27.setNum(my_float) << endl;
+    cout << "s27: " << s27.setNum(my_double) << endl;
+    cout << "s27: " << s27.setNum(my_int) << endl;
+    cout << "s27: " << s27.setNum(my_int) << endl;
+    cout << "s27: " << s27.setNum(my_long) << endl;
+    cout << "s27: " << s27.setNum(my_short) << endl;
+    cout << "s27: " << s27.setNum(my_unit) << endl;
+    cout << "s27: " << s27.setNum(my_ulong) << endl;
+    cout << "s27: " << s27.setNum(my_ushort) << endl;
+    cout << "s27: " << s27.setNum(my_float) << endl;
     
     QString s28;
     QString s29 = "a string that is a little long";
-    cout << !s28 << endl;
-    cout << !s29 << endl;
+    cout << "s28 !: " << !s28 << endl;
+    cout << "s29 !: " << !s29 << endl;
     
     QString s30 = "abcde";
     QChar c3='f';
-    QChar ch2='g';
+    char ch2='g';
     QString s31 = "hijk";
-    cout << (s30 += c3) << endl;
-    cout << (s30 += ch2) << endl;
-    cout << (s30 += s31) << endl;
+    cout << "s30: " << s30 << endl;
+    cout << "c3: " << c3 << endl;
+    cout << "ch2: " << ch2 << endl;
+    cout << "s31: " << s31 << endl;
+    cout << "s30 += c3: " << (s30 += c3) << endl;
+    cout << "s30 += ch2: " << (s30 += ch2) << endl;
+    cout << "s30 += s31: " << (s30 += s31) << endl;
     
     
     // test operators
     
     QString s33 = "This is a string";
     QString s34 = "This is a longer string";
-    char c4[25];
-    strcpy(c4, "This is an even longer string");
-    cout << (s33 < c4) << endl;
-    cout << (c4 < s33) << endl;
-    cout << (s33 < s34) << endl;
-    cout << (s33 > c4) << endl;
-    //cout << (c4 > s33) << endl; //compiler says this is not a supported function. 
-                                  //Documentation says bool operator> (const char * s1, const QString & s2) 
-    cout << (s33 > s34) << endl;
-    cout << (s33 == c4) << endl;
-    cout << (c4 == s33) << endl;
-    cout << (s33 == s34) << endl;
-    cout << (s33 != c4) << endl;
-    cout << (c4 != s33) << endl;
-    cout << (s33 != s34) << endl;    
-    cout << (s33 <= c4) << endl;
-    cout << (c4 <= s33) << endl;
-    cout << (s33 <= s34) << endl;
-    cout << (s33 >= c4) << endl;
-    cout << (c4 >= s33) << endl;
-    cout << (s33 >= s34) << endl;
+    char ch3[30];
+    strcpy(ch3, "This is an even longer string");
+    QChar c4 ='T';
+    cout << "s33: " << s33 << endl;
+    cout << "s34: " << s34 << endl;
+    cout << "ch3: " << ch3 << endl;
+    cout << "c4: " << c4 << endl;
+    cout << "s33 == ch3: " << (s33 == ch3) << endl;   // I should test strings that are equal as well
+    cout << "c3 == s33: "<< (c4 == s33) << endl;
+    cout << "s33 == s34: "<< (s33 == s34) << endl;
+    cout << "s33 == c4: "<< (s33 == c4) << endl;
+    cout << "s33 != ch3: " << (s33 != ch3) << endl;
+    cout << "c3 != s33: "<< (c4 != s33) << endl;
+    cout << "s33 != s34: "<< (s33 != s34) << endl;
+    cout << "s33 != c4: "<< (s33 != c4) << endl; 
+    cout << "ch3 + s33: " << (ch3 + s33) << endl;
+    cout << "c4 + s33: " << (c4 + s33) << endl;
+    cout << "\'a\' + s33: " << ('a' + s33) << endl;
+    
+    //cout << (s33 < c4) << endl;
+    //cout << (c4 < s33) << endl;
+    //cout << (s33 < s34) << endl;
+    //cout << (s33 > c4) << endl;
+    //cout << (c4 > s33) << endl;
+    //cout << (s33 > s34) << endl;   
+    //cout << (s33 <= c4) << endl;
+    //cout << (c4 <= s33) << endl;
+    //cout << (s33 <= s34) << endl;
+    //cout << (s33 >= c4) << endl;
+    //cout << (c4 >= s33) << endl;
+    //cout << (s33 >= s34) << endl;
     
     
         

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list