diff options
Diffstat (limited to 'tests/auto/corelib/text/qlocale/tst_qlocale.cpp')
-rw-r--r-- | tests/auto/corelib/text/qlocale/tst_qlocale.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp index 327cb7d714..04c54b903b 100644 --- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp @@ -150,6 +150,8 @@ private slots: void numberGroupingIndia(); void numberFormatChakma(); + void lcsToCode(); + // *** ORDER-DEPENDENCY *** (This Is Bad.) // Test order is determined by order of declaration here: *all* tests that // QLocale::setDefault() *must* appear *after* all other tests ! @@ -3224,5 +3226,19 @@ void tst_QLocale::numberFormatChakma() QCOMPARE(chakma.toULongLong(strResult64), uint64); } +void tst_QLocale::lcsToCode() +{ + QCOMPARE(QLocale::languageToCode(QLocale::AnyLanguage), QString()); + QCOMPARE(QLocale::languageToCode(QLocale::C), QString("C")); + QCOMPARE(QLocale::languageToCode(QLocale::English), QString("en")); + + QCOMPARE(QLocale::countryToCode(QLocale::AnyCountry), QString()); + QCOMPARE(QLocale::countryToCode(QLocale::UnitedStates), QString("US")); + QCOMPARE(QLocale::countryToCode(QLocale::EuropeanUnion), QString("EU")); + + QCOMPARE(QLocale::scriptToCode(QLocale::AnyScript), QString()); + QCOMPARE(QLocale::scriptToCode(QLocale::SimplifiedHanScript), QString("Hans")); +} + QTEST_MAIN(tst_QLocale) #include "tst_qlocale.moc" |