summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-03-22 10:53:45 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-26 11:41:07 +0200
commit8660f6e385b2070db1b33dab85b5686a00fec06b (patch)
tree6046c82010c5e29454cfe071be0ca80ec70e683a /tests/auto
parentbc0b37d6b61fc8ab83026d6a5e515666e58d7938 (diff)
Fix measurement system for the UK
THe UK still uses the Imperial system at least for distances and many other things. Change-Id: I99379de35620114328ad6a7fc9b226a46692bedd Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/tools/qlocale/tst_qlocale.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
index b3b573c64b..f9de2f0c05 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 weekendDays();
void listPatterns();
+ void measurementSystems();
+
private:
QString m_decimal, m_thousand, m_sdate, m_ldate, m_time;
QString m_sysapp;
@@ -2034,5 +2036,20 @@ void tst_QLocale::listPatterns()
QCOMPARE(zh_CN.createSeparatedList(sl5), QString::fromUtf8("aaa" "\xe3\x80\x81" "bbb" "\xe3\x80\x81" "ccc" "\xe5\x92\x8c" "ddd"));
}
+void tst_QLocale::measurementSystems()
+{
+ QLocale locale(QLocale::English, QLocale::UnitedStates);
+ QCOMPARE(locale.measurementSystem(), QLocale::ImperialUSSystem);
+
+ locale = QLocale(QLocale::English, QLocale::UnitedKingdom);
+ QCOMPARE(locale.measurementSystem(), QLocale::ImperialUKSystem);
+
+ locale = QLocale(QLocale::English, QLocale::Australia);
+ QCOMPARE(locale.measurementSystem(), QLocale::MetricSystem);
+
+ locale = QLocale(QLocale::German);
+ QCOMPARE(locale.measurementSystem(), QLocale::MetricSystem);
+}
+
QTEST_MAIN(tst_QLocale)
#include "tst_qlocale.moc"