summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-10-13 21:48:08 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-04-07 07:02:38 +0000
commitf72152381b37740e65f174e175306d21c7616549 (patch)
tree5c134d98ac1878b905d399d9b929b795786e0ea3 /tests/auto/corelib/tools/qstringbuilder/qstringbuilder1
parentd37239aa419ee4adff4b0a8d5c1403cadff72319 (diff)
tst_QStringBuilder: add a check for self-assignment
Change-Id: I78094146bf534163af12d6e265276d987d5ce994 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'tests/auto/corelib/tools/qstringbuilder/qstringbuilder1')
-rw-r--r--tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp
index e3b25c4c81..777fd5392c 100644
--- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp
+++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp
@@ -93,6 +93,11 @@ void runScenario()
r = special + string;
QCOMPARE(r, QString(special P string));
+ // self-assignment:
+ r = stringref.toString();
+ r = achar + r;
+ QCOMPARE(r, QString(achar P stringref));
+
#ifdef Q_COMPILER_UNICODE_STRINGS
r = QStringLiteral(UNICODE_LITERAL);
r = r Q QStringLiteral(UNICODE_LITERAL);