summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/text/qstringref/tst_qstringref.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/text/qstringref/tst_qstringref.cpp')
-rw-r--r--tests/auto/corelib/text/qstringref/tst_qstringref.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/corelib/text/qstringref/tst_qstringref.cpp b/tests/auto/corelib/text/qstringref/tst_qstringref.cpp
index 6f01947131..20d5426bf7 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()
@@ -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"