summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMehdi Fekari <mfekari@rim.com>2013-01-05 16:49:48 -0500
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-06 14:29:48 +0100
commit33f603c4a3fd277b0cc40335d6649b43e76b7abf (patch)
tree14e8fd0d0a5ae2aa39f57d8b9536e9246416c3b6
parentcf22e8ea4eb43c736486a2c0b61b73ec1831d90b (diff)
Update qlocale autotest
Add additional tests for the updates in the Qt4.8 qlocale data (CLDRv2.0) already existing in Qt5 locale data (CLDRv22.1): - The NumberingSystem for some Indic and Slovak locales. - The Month/Day name in Irish/Gaelic locale. - The AM/PM Text in Turkish locale. Change-Id: Iaea4f13ec79f94ab937b97f8ae60eb8d8f217c4b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
-rw-r--r--tests/auto/corelib/tools/qlocale/tst_qlocale.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
index 1acad071f7..62d6c4f462 100644
--- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
+++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
@@ -133,6 +133,8 @@ private slots:
void monthName();
void standaloneMonthName();
+ void defaultNumeringSystem();
+
void ampm();
void currency();
void quoteString();
@@ -1527,6 +1529,10 @@ void tst_QLocale::dayName()
QLocale l(locale_name);
QCOMPARE(l.dayName(day, format), dayName);
+
+ QLocale ir("ga_IE");
+ QCOMPARE(ir.dayName(1, QLocale::ShortFormat), QLatin1String("Luan"));
+ QCOMPARE(ir.dayName(7, QLocale::ShortFormat), QLatin1String("Domh"));
}
void tst_QLocale::standaloneDayName_data()
@@ -1586,6 +1592,42 @@ a(QLatin1String("0.0000000000000000000000000000000000000000000000000000000000000
QVERIFY(!ok);
}
+void tst_QLocale::defaultNumeringSystem()
+{
+ QLocale sk("sk_SK");
+ QCOMPARE(sk.toString(123), QLatin1String("123"));
+
+ QLocale ta("ta_IN");
+ QCOMPARE(ta.toString(123), QLatin1String("123"));
+
+ QLocale te("te_IN");
+ QCOMPARE(te.toString(123), QLatin1String("123"));
+
+ QLocale hi("hi_IN");
+ QCOMPARE(hi.toString(123), QLatin1String("123"));
+
+ QLocale gu("gu_IN");
+ QCOMPARE(gu.toString(123), QLatin1String("123"));
+
+ QLocale kn("kn_IN");
+ QCOMPARE(kn.toString(123), QLatin1String("123"));
+
+ QLocale pa("pa_IN");
+ QCOMPARE(pa.toString(123), QLatin1String("123"));
+
+ QLocale ne("ne_IN");
+ QCOMPARE(ne.toString(123), QLatin1String("123"));
+
+ QLocale mr("mr_IN");
+ QCOMPARE(mr.toString(123), QLatin1String("123"));
+
+ QLocale ml("ml_IN");
+ QCOMPARE(ml.toString(123), QLatin1String("123"));
+
+ QLocale kok("kok_IN");
+ QCOMPARE(kok.toString(123), QLatin1String("123"));
+}
+
void tst_QLocale::ampm()
{
QLocale c(QLocale::C);
@@ -1607,6 +1649,10 @@ void tst_QLocale::ampm()
QLocale ua("uk_UA");
QCOMPARE(ua.amText(), QString::fromUtf8("\320\264\320\277"));
QCOMPARE(ua.pmText(), QString::fromUtf8("\320\277\320\277"));
+
+ QLocale tr("tr_TR");
+ QCOMPARE(tr.amText(), QString::fromUtf8("\303\226\303\226"));
+ QCOMPARE(tr.pmText(), QString::fromUtf8("\303\226\123"));
}
void tst_QLocale::dateFormat()
@@ -1673,6 +1719,10 @@ void tst_QLocale::monthName()
// check that our CLDR scripts handle surrogate pairs correctly
QLocale dsrt("en-Dsrt-US");
QCOMPARE(dsrt.monthName(1, QLocale::LongFormat), QString::fromUtf8("\xf0\x90\x90\x96\xf0\x90\x90\xb0\xf0\x90\x91\x8c\xf0\x90\x90\xb7\xf0\x90\x90\xad\xf0\x90\x90\xaf\xf0\x90\x91\x89\xf0\x90\x90\xa8"));
+
+ QLocale ir("ga_IE");
+ QCOMPARE(ir.monthName(1, QLocale::ShortFormat), QLatin1String("Ean"));
+ QCOMPARE(ir.monthName(12, QLocale::ShortFormat), QLatin1String("Noll"));
}
void tst_QLocale::standaloneMonthName()