summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qstring/tst_qstring.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-11-18 09:01:51 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2015-11-18 09:01:51 +0100
commitc7934f2489e2eb9a539206bab35f335b1943c5bd (patch)
treea27d0ed6c001fe9432e2a0f28fb935acf9e4c65f /tests/auto/corelib/tools/qstring/tst_qstring.cpp
parentf40593b11199fbef886bfcb6b210a214d8c3adf3 (diff)
parent08f9a1bd6ab9b1777ee5ba163d75e5c848c39eb4 (diff)
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts: src/corelib/io/qprocess.cpp src/corelib/io/qprocess_unix.cpp src/network/kernel/qnetworkinterface_winrt.cpp tools/configure/configureapp.cpp Change-Id: I47df00a01597d2e63b334b492b3b4221b29f58ea
Diffstat (limited to 'tests/auto/corelib/tools/qstring/tst_qstring.cpp')
-rw-r--r--tests/auto/corelib/tools/qstring/tst_qstring.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
index cb911853e8..b18aaa2534 100644
--- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp
+++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
@@ -2142,6 +2142,22 @@ void tst_QString::toUpper()
QCOMPARE( QString("`abyz{").toUpper(), QString("`ABYZ{"));
QCOMPARE( QString(1, QChar(0xdf)).toUpper(), QString("SS"));
+ {
+ QString s = QString::fromUtf8("Gro\xc3\x9fstra\xc3\x9f""e");
+
+ // call lvalue-ref version, mustn't change the original
+ QCOMPARE(s.toUpper(), QString("GROSSSTRASSE"));
+ QCOMPARE(s, QString::fromUtf8("Gro\xc3\x9fstra\xc3\x9f""e"));
+
+ // call rvalue-ref while shared (the original mustn't change)
+ QString copy = s;
+ QCOMPARE(qMove(copy).toUpper(), QString("GROSSSTRASSE"));
+ QCOMPARE(s, QString::fromUtf8("Gro\xc3\x9fstra\xc3\x9f""e"));
+
+ // call rvalue-ref version on detached case
+ copy.clear();
+ QCOMPARE(qMove(s).toUpper(), QString("GROSSSTRASSE"));
+ }
QString lower, upper;
lower += QChar(QChar::highSurrogate(0x10428));