summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/text/qstring/tst_qstring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/text/qstring/tst_qstring.cpp')
-rw-r--r--tests/auto/corelib/text/qstring/tst_qstring.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp
index 5c46ae6ae1..61f775f4d8 100644
--- a/tests/auto/corelib/text/qstring/tst_qstring.cpp
+++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp
@@ -4216,9 +4216,15 @@ void tst_QString::nullFromUtf8()
a = QString::fromUtf8(0);
QVERIFY(a.isNull());
QVERIFY(a.isEmpty());
+ a = QString::fromUtf8(nullptr);
+ QVERIFY(a.isNull());
+ QVERIFY(a.isEmpty());
a = QString::fromUtf8("");
QVERIFY(!a.isNull());
QVERIFY(a.isEmpty());
+ a = QString::fromUtf8(u8""); // char in C++17 / char8_t in C++20
+ QVERIFY(!a.isNull());
+ QVERIFY(a.isEmpty());
a = QString::fromUtf8(QByteArray());
QVERIFY(a.isNull());
QVERIFY(a.isEmpty());