summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qstring
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@digia.com>2012-09-19 15:40:41 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-09-24 16:53:13 +0200
commitc06106f28db343a090869b7d0f8638aa89f91640 (patch)
tree00b3f5980f84ffeb50358094f4c60fd47eedc936 /tests/auto/corelib/tools/qstring
parent09c90346aa5d44e27daac774413b0354258da71f (diff)
Fix potential breakage in QString.
Negation operator ("!") have precedence over bitwise and ("&"). Change-Id: I39e2d99da6eaa4477bbe35a1259f745e05c9841a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/tools/qstring')
-rw-r--r--tests/auto/corelib/tools/qstring/tst_qstring.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
index ab5d7ab6ac..2b00ec8c20 100644
--- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp
+++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
@@ -5339,11 +5339,15 @@ void tst_QString::compareRef()
void tst_QString::arg_locale()
{
QLocale l(QLocale::English, QLocale::UnitedKingdom);
+ QString str("*%L1*%L2*");
+
+ QCOMPARE(str.arg(123456).arg(1234.56), QString::fromLatin1("*123,456*1,234.56*"));
+ QLocale::setDefault(l);
+
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*"));
+ QCOMPARE(str.arg(123456).arg(1234.56), QString::fromLatin1("*123456*1234.56*"));
+
QLocale::setDefault(QLocale::C);
}