diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/tools/qlocale/tst_qlocale.cpp | 17 |
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" |