summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/text/qstring/qstring.pro3
-rw-r--r--tests/auto/corelib/text/qstring/tst_qstring.cpp6
2 files changed, 8 insertions, 1 deletions
diff --git a/tests/auto/corelib/text/qstring/qstring.pro b/tests/auto/corelib/text/qstring/qstring.pro
index 5fff5530b7..9a478b134e 100644
--- a/tests/auto/corelib/text/qstring/qstring.pro
+++ b/tests/auto/corelib/text/qstring/qstring.pro
@@ -3,7 +3,8 @@ TARGET = tst_qstring
QT = core-private testlib
SOURCES = tst_qstring.cpp
# DEFINES += QT_NO_CAST_TO_ASCII # actively #undef-ed by tst_qstring.cpp
-qtConfig(c++11): CONFIG += c++11
+qtConfig(c++1z): CONFIG += c++1z
+qtConfig(c++2a): CONFIG += c++2a
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
!qtConfig(doubleconversion):!qtConfig(system-doubleconversion) {
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());