diff options
Diffstat (limited to 'tests/auto/corelib/text/qstringref/tst_qstringref.cpp')
-rw-r--r-- | tests/auto/corelib/text/qstringref/tst_qstringref.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/auto/corelib/text/qstringref/tst_qstringref.cpp b/tests/auto/corelib/text/qstringref/tst_qstringref.cpp index dcc825942d..f8049ffabc 100644 --- a/tests/auto/corelib/text/qstringref/tst_qstringref.cpp +++ b/tests/auto/corelib/text/qstringref/tst_qstringref.cpp @@ -87,6 +87,7 @@ private slots: void mid(); void split_data(); void split(); + void nullToString(); }; static QStringRef emptyRef() @@ -164,7 +165,7 @@ static inline double nan() void tst_QStringRef::cleanup() { - QLocale::setDefault(QString(QLatin1Char('C'))); + QLocale::setDefault(QLocale(QString(QLatin1Char('C')))); } void tst_QStringRef::at() @@ -2177,6 +2178,18 @@ void tst_QStringRef::split() } } +void tst_QStringRef::nullToString() +{ + QStringRef nullRef; + QVERIFY(nullRef.isNull()); + QVERIFY(nullRef.toString().isNull()); + + QString str; + nullRef = &str; + QVERIFY(nullRef.isNull()); + QVERIFY(nullRef.toString().isNull()); +} + QTEST_APPLESS_MAIN(tst_QStringRef) #include "tst_qstringref.moc" |