[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:10 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 8dd927366a12757a623d032ef21a07139fd9fef6
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Sep 25 22:28:53 2001 +0000
Adding more functions to qstring-test
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@194 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/kwq/tests/qt/qstring-test.chk b/WebCore/kwq/tests/qt/qstring-test.chk
index f8f1a4a..4b67a14 100644
--- a/WebCore/kwq/tests/qt/qstring-test.chk
+++ b/WebCore/kwq/tests/qt/qstring-test.chk
@@ -7,7 +7,6 @@ test
yet another string
hello there
e
-aÿûe
1
0
1
@@ -33,3 +32,73 @@ ttttt
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
diff --git a/WebCore/kwq/tests/qt/qstring-test.cpp b/WebCore/kwq/tests/qt/qstring-test.cpp
index f94b439..4ceff11 100644
--- a/WebCore/kwq/tests/qt/qstring-test.cpp
+++ b/WebCore/kwq/tests/qt/qstring-test.cpp
@@ -8,7 +8,7 @@ int main() {
QByteArray ba = QByteArray(5);
ba.fill('e', -1);
QCString qcs = QCString("hello there");
- char ch='a';
+ //char ch='a';
c[0] = QChar('t');
c[1] = QChar('e');
@@ -25,7 +25,7 @@ int main() {
QString s7 = "yet another string";
QString s8 = qcs;
QString s9 = c[1];
- QString s10 = &ch;
+ //QString s10 = ch;
cout << s1 << endl;
cout << s2 << endl;
@@ -36,7 +36,7 @@ int main() {
cout << s7 << endl;
cout << s8 << endl;
cout << s9 << endl;
- cout << s10 << endl;
+ //cout << s10 << endl;
QString s11 = QString(""); // make an empty string
@@ -79,5 +79,128 @@ int main() {
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;
+
+ QString s15 = "Hello %1. How has your %2 been?";
+ double my_double =22.45;
+ int my_int = 356;
+ long my_long = 23390082;
+ short my_short = 3456;
+ uint my_unit = 234234224;
+ 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 s16 = "THIS WAS A STRING IN UPPERCASE";
+ QString s17 = "this was a string in lowercase";
+ cout << s16.lower() << endl;
+ cout << 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
+
+ QString s19 = "221545";
+ 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;
+
+ QString s21 = "Apple Computer Inc.";
+ QString s22 = "Apple";
+ QString s23 = "MS";
+ cout << s21.startsWith(s22) << endl;
+ cout << s21.startsWith(s23) << endl;
+
+ QString s24 = "The answer is: ";
+ QChar c2 = '2';
+ cout << s24.insert(15, c2) << 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(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;
+
+ QString s28;
+ QString s29 = "a string that is a little long";
+ cout << !s28 << endl;
+ cout << !s29 << endl;
+
+ QString s30 = "abcde";
+ QChar c3='f';
+ QChar ch2='g';
+ QString s31 = "hijk";
+ cout << (s30 += c3) << endl;
+ cout << (s30 += ch2) << endl;
+ cout << (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;
+
+
+
return 0;
}
diff --git a/WebCore/src/kwq/tests/qt/qstring-test.chk b/WebCore/src/kwq/tests/qt/qstring-test.chk
index f8f1a4a..4b67a14 100644
--- a/WebCore/src/kwq/tests/qt/qstring-test.chk
+++ b/WebCore/src/kwq/tests/qt/qstring-test.chk
@@ -7,7 +7,6 @@ test
yet another string
hello there
e
-aÿûe
1
0
1
@@ -33,3 +32,73 @@ ttttt
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
diff --git a/WebCore/src/kwq/tests/qt/qstring-test.cpp b/WebCore/src/kwq/tests/qt/qstring-test.cpp
index f94b439..4ceff11 100644
--- a/WebCore/src/kwq/tests/qt/qstring-test.cpp
+++ b/WebCore/src/kwq/tests/qt/qstring-test.cpp
@@ -8,7 +8,7 @@ int main() {
QByteArray ba = QByteArray(5);
ba.fill('e', -1);
QCString qcs = QCString("hello there");
- char ch='a';
+ //char ch='a';
c[0] = QChar('t');
c[1] = QChar('e');
@@ -25,7 +25,7 @@ int main() {
QString s7 = "yet another string";
QString s8 = qcs;
QString s9 = c[1];
- QString s10 = &ch;
+ //QString s10 = ch;
cout << s1 << endl;
cout << s2 << endl;
@@ -36,7 +36,7 @@ int main() {
cout << s7 << endl;
cout << s8 << endl;
cout << s9 << endl;
- cout << s10 << endl;
+ //cout << s10 << endl;
QString s11 = QString(""); // make an empty string
@@ -79,5 +79,128 @@ int main() {
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;
+
+ QString s15 = "Hello %1. How has your %2 been?";
+ double my_double =22.45;
+ int my_int = 356;
+ long my_long = 23390082;
+ short my_short = 3456;
+ uint my_unit = 234234224;
+ 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 s16 = "THIS WAS A STRING IN UPPERCASE";
+ QString s17 = "this was a string in lowercase";
+ cout << s16.lower() << endl;
+ cout << 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
+
+ QString s19 = "221545";
+ 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;
+
+ QString s21 = "Apple Computer Inc.";
+ QString s22 = "Apple";
+ QString s23 = "MS";
+ cout << s21.startsWith(s22) << endl;
+ cout << s21.startsWith(s23) << endl;
+
+ QString s24 = "The answer is: ";
+ QChar c2 = '2';
+ cout << s24.insert(15, c2) << 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(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;
+
+ QString s28;
+ QString s29 = "a string that is a little long";
+ cout << !s28 << endl;
+ cout << !s29 << endl;
+
+ QString s30 = "abcde";
+ QChar c3='f';
+ QChar ch2='g';
+ QString s31 = "hijk";
+ cout << (s30 += c3) << endl;
+ cout << (s30 += ch2) << endl;
+ cout << (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;
+
+
+
return 0;
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list