summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qstring/tst_qstring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/tools/qstring/tst_qstring.cpp')
-rw-r--r--tests/auto/corelib/tools/qstring/tst_qstring.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
index 48874781c0..a0edc16718 100644
--- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp
+++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
@@ -1440,6 +1440,8 @@ void tst_QString::contains()
QVERIFY(a.contains('F',Qt::CaseInsensitive));
QVERIFY(a.contains("FG"));
QVERIFY(a.contains("FG",Qt::CaseInsensitive));
+ QVERIFY(a.contains(QLatin1String("FG")));
+ QVERIFY(a.contains(QLatin1String("fg"),Qt::CaseInsensitive));
QVERIFY(a.contains( QString(), Qt::CaseInsensitive));
QVERIFY(a.contains( "", Qt::CaseInsensitive));
QVERIFY(a.contains(QRegExp("[FG][HI]")));
@@ -3880,6 +3882,14 @@ void tst_QString::toLatin1Roundtrip()
// and back:
QCOMPARE(QString::fromLatin1(latin1, latin1.length()).length(), unicodedst.length());
QCOMPARE(QString::fromLatin1(latin1, latin1.length()), unicodedst);
+
+ // try the rvalue version of toLatin1()
+ QString s = unicodesrc;
+ QCOMPARE(qMove(s).toLatin1(), latin1);
+
+ // and verify that the moved-from object can still be used
+ s = "foo";
+ s.clear();
}
void tst_QString::stringRef_toLatin1Roundtrip_data()