summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authormfekari <mfekari@rim.com>2012-12-10 13:51:36 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-12-14 07:22:39 (GMT)
commit94a5839d74d53832674cd6eca49c980bac27fc04 (patch)
tree3afe31c00a450a14004bfdcfaa96246220abde11 /tests
parent481ab62f821c70984df39880497da920e7a226e6 (diff)
downloadQt-94a5839d74d53832674cd6eca49c980bac27fc04.zip
Qt-94a5839d74d53832674cd6eca49c980bac27fc04.tar.gz
Qt-94a5839d74d53832674cd6eca49c980bac27fc04.tar.bz2
Update defaultNumberingSystem value for some indic and slovak countries/regions
Qt gets the information about locale digits from the <defaultNumberingSystem> entries in the CLDR data xm files. Current CLDR data in Qt4.8 is 2.0, which specifies native digits for most of Indic locales and arabic digits for slovak locale. This doesn't concern Qt5 that uses the most recent version of CLDR (22.1) which specify Latin digits for the locales in question. This patch updates the defaultNumberingSystem (to latin) and provides an autotest to compare the returned vs expected digits for the following langagues/regions: - Gujarati, Hindi, Kannada, Konkani, Malayalam, Marathi, Nepali, Punjabi, Tamil, Telugu (to use latin digits instead of native ones) - Slovak (to use latin digits instead of arabic ones) Change-Id: I04364cdb80292f7705b1321377623298a01a9c5b Reviewed-by: Vladimir Minenko <vminenko@rim.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qlocale/tst_qlocale.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/auto/qlocale/tst_qlocale.cpp b/tests/auto/qlocale/tst_qlocale.cpp
index d7e278f..d0155f8 100644
--- a/tests/auto/qlocale/tst_qlocale.cpp
+++ b/tests/auto/qlocale/tst_qlocale.cpp
@@ -140,6 +140,10 @@ private slots:
void queryDateTime();
void queryMeasureSystem_data();
void queryMeasureSystem();
+
+ // defaultNumberingSystem test
+ void defaultNumeringSystem();
+
#if defined(Q_OS_SYMBIAN)
void symbianSystemLocale();
#endif
@@ -1752,6 +1756,42 @@ void tst_QLocale::queryMeasureSystem()
}
#endif // QT_NO_SYSTEMLOCALE
+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);