summaryrefslogtreecommitdiffstats
path: root/tests/auto/qchar
diff options
context:
space:
mode:
authorRitt Konstantin <ritt.ks@gmail.com>2010-05-20 08:47:19 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-05-20 08:47:19 (GMT)
commit9c13272ddeea2408c83eb12a9f1fcceeb6a7589e (patch)
treec04332857872db8c448942b38f404c3f737e6d22 /tests/auto/qchar
parent173e2c1ba81b9a2665c040a9e86d085131e5042e (diff)
downloadQt-9c13272ddeea2408c83eb12a9f1fcceeb6a7589e.zip
Qt-9c13272ddeea2408c83eb12a9f1fcceeb6a7589e.tar.gz
Qt-9c13272ddeea2408c83eb12a9f1fcceeb6a7589e.tar.bz2
more subtests for QChar
Merge-request: 2392 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
Diffstat (limited to 'tests/auto/qchar')
-rw-r--r--tests/auto/qchar/tst_qchar.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qchar/tst_qchar.cpp b/tests/auto/qchar/tst_qchar.cpp
index 5ca2255..9f70b8c 100644
--- a/tests/auto/qchar/tst_qchar.cpp
+++ b/tests/auto/qchar/tst_qchar.cpp
@@ -75,6 +75,7 @@ private slots:
void isPrint();
void isUpper();
void isLower();
+ void isTitle();
void category();
void direction();
void joining();
@@ -234,6 +235,11 @@ void tst_QChar::isUpper()
QVERIFY(!QChar('?').isUpper());
QVERIFY(QChar(0xC2).isUpper()); // A with ^
QVERIFY(!QChar(0xE2).isUpper()); // a with ^
+
+ for (uint codepoint = 0; codepoint <= UNICODE_LAST_CODEPOINT; ++codepoint) {
+ if (QChar::category(codepoint) == QChar::Letter_Uppercase)
+ QVERIFY(codepoint == QChar::toUpper(codepoint));
+ }
}
void tst_QChar::isLower()
@@ -245,6 +251,19 @@ void tst_QChar::isLower()
QVERIFY(!QChar('?').isLower());
QVERIFY(!QChar(0xC2).isLower()); // A with ^
QVERIFY(QChar(0xE2).isLower()); // a with ^
+
+ for (uint codepoint = 0; codepoint <= UNICODE_LAST_CODEPOINT; ++codepoint) {
+ if (QChar::category(codepoint) == QChar::Letter_Lowercase)
+ QVERIFY(codepoint == QChar::toLower(codepoint));
+ }
+}
+
+void tst_QChar::isTitle()
+{
+ for (uint codepoint = 0; codepoint <= UNICODE_LAST_CODEPOINT; ++codepoint) {
+ if (QChar::category(codepoint) == QChar::Letter_Titlecase)
+ QVERIFY(codepoint == QChar::toTitleCase(codepoint));
+ }
}
void tst_QChar::category()