diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2010-08-09 14:11:46 +0200 |
---|---|---|
committer | Samuli Piippo <samuli.piippo@digia.com> | 2011-06-09 13:06:38 +0300 |
commit | 52fe778df2310660c84db581c53e2c3fae2cc42a (patch) | |
tree | a89ff8af40f026b67257d440191164354ac140ce /tests/auto/qstring/tst_qstring.cpp | |
parent | 7da79f8d44ba06872e5bf298fde7a3fc45df7046 (diff) | |
download | qt4-tools-52fe778df2310660c84db581c53e2c3fae2cc42a.tar.gz |
Fix QString::arg: When specifying %L1, the group separator would be added even if the local specify QLocale::OmitGroupSeparator
Task-number: QTBUG-9281
Reviewed-by: Denis
(cherry picked from commit 720f4ca0ec3b42a101ac24b2cf74cdc87d29eac9)
Diffstat (limited to 'tests/auto/qstring/tst_qstring.cpp')
-rw-r--r-- | tests/auto/qstring/tst_qstring.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qstring/tst_qstring.cpp b/tests/auto/qstring/tst_qstring.cpp index 5a153dede9..d26f5e61cc 100644 --- a/tests/auto/qstring/tst_qstring.cpp +++ b/tests/auto/qstring/tst_qstring.cpp @@ -203,6 +203,7 @@ private slots: void repeated_data() const; void task262677remove(); void QTBUG10404_compareRef(); + void QTBUG9281_arg_locale(); }; typedef QList<int> IntList; @@ -4712,6 +4713,17 @@ void tst_QString::QTBUG10404_compareRef() QVERIFY(QStringRef(&a2, 1, 2).compare(QStringRef(&a, 1, 3), Qt::CaseInsensitive) < 0); } +void tst_QString::QTBUG9281_arg_locale() +{ + QLocale l(QLocale::English, QLocale::UnitedKingdom); + l.setNumberOptions(QLocale::OmitGroupSeparator); + QLocale::setDefault(l); + QString str("*%L1*%L2*"); + str = str.arg(123456).arg(1234.56); + QCOMPARE(str, QString::fromLatin1("*123456*1234.56*")); + QLocale::setDefault(QLocale::C); +} + QTEST_APPLESS_MAIN(tst_QString) |