summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/text
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-07-26 22:43:05 +0300
committerMarc Mutz <marc.mutz@kdab.com>2019-08-10 22:13:49 +0200
commitc58ca4256d881ffed865602fd3da8efb6ebc9d5f (patch)
tree2619858d2e21ebee531d8c9e2a7af39e23683fca /tests/auto/corelib/text
parentb7d073e9905bf9812ba96cecdcf6871a95517d30 (diff)
Deprecate QStringViewLiteral
As a macro, we can't directly deprecate it, but need to make it call something deprecated. That is a new ctor with a new enum type added. The type might be useful for other such ventures, so put it into qglobal.h Remove the QT_NO_UNICODE_LITERAL protection, as it's always false these days, and QT_UNICODE_LITERAL is unconditionally #defined a 20 lines above. [ChangeLog][QtCore][QStringView] Deprecated the (undocumented) QStringViewLiteral macro. Just use u"" or QStringView(u"") instead. Change-Id: I9141320225037e1bc6b7f920bf01a9d0144fdac2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/auto/corelib/text')
-rw-r--r--tests/auto/corelib/text/qlatin1string/tst_qlatin1string.cpp8
-rw-r--r--tests/auto/corelib/text/qstringview/tst_qstringview.cpp12
2 files changed, 10 insertions, 10 deletions
diff --git a/tests/auto/corelib/text/qlatin1string/tst_qlatin1string.cpp b/tests/auto/corelib/text/qlatin1string/tst_qlatin1string.cpp
index cf46159251..0427c81b85 100644
--- a/tests/auto/corelib/text/qlatin1string/tst_qlatin1string.cpp
+++ b/tests/auto/corelib/text/qlatin1string/tst_qlatin1string.cpp
@@ -70,7 +70,7 @@ void tst_QLatin1String::arg() const
do { \
auto p = QLatin1String(pattern); \
QCOMPARE(p.arg(QLatin1String(arg1)), expected); \
- QCOMPARE(p.arg(QStringViewLiteral(arg1)), expected); \
+ QCOMPARE(p.arg(u"" arg1), expected); \
QCOMPARE(p.arg(QStringLiteral(arg1)), expected); \
QCOMPARE(p.arg(QString(QLatin1String(arg1))), expected); \
} while (false) \
@@ -79,9 +79,9 @@ void tst_QLatin1String::arg() const
do { \
auto p = QLatin1String(pattern); \
QCOMPARE(p.arg(QLatin1String(arg1), QLatin1String(arg2)), expected); \
- QCOMPARE(p.arg(QStringViewLiteral(arg1), QLatin1String(arg2)), expected); \
- QCOMPARE(p.arg(QLatin1String(arg1), QStringViewLiteral(arg2)), expected); \
- QCOMPARE(p.arg(QStringViewLiteral(arg1), QStringViewLiteral(arg2)), expected); \
+ QCOMPARE(p.arg(u"" arg1, QLatin1String(arg2)), expected); \
+ QCOMPARE(p.arg(QLatin1String(arg1), u"" arg2), expected); \
+ QCOMPARE(p.arg(u"" arg1, u"" arg2), expected); \
} while (false) \
/*end*/
diff --git a/tests/auto/corelib/text/qstringview/tst_qstringview.cpp b/tests/auto/corelib/text/qstringview/tst_qstringview.cpp
index 5d95f43d6a..47ce9a6f63 100644
--- a/tests/auto/corelib/text/qstringview/tst_qstringview.cpp
+++ b/tests/auto/corelib/text/qstringview/tst_qstringview.cpp
@@ -431,20 +431,20 @@ void tst_QStringView::arg() const
{
#define CHECK1(pattern, arg1, expected) \
do { \
- auto p = QStringViewLiteral(pattern); \
+ auto p = QStringView(u"" pattern); \
QCOMPARE(p.arg(QLatin1String(arg1)), expected); \
- QCOMPARE(p.arg(QStringViewLiteral(arg1)), expected); \
+ QCOMPARE(p.arg(u"" arg1), expected); \
QCOMPARE(p.arg(QStringLiteral(arg1)), expected); \
QCOMPARE(p.arg(QString(QLatin1String(arg1))), expected); \
} while (false) \
/*end*/
#define CHECK2(pattern, arg1, arg2, expected) \
do { \
- auto p = QStringViewLiteral(pattern); \
+ auto p = QStringView(u"" pattern); \
QCOMPARE(p.arg(QLatin1String(arg1), QLatin1String(arg2)), expected); \
- QCOMPARE(p.arg(QStringViewLiteral(arg1), QLatin1String(arg2)), expected); \
- QCOMPARE(p.arg(QLatin1String(arg1), QStringViewLiteral(arg2)), expected); \
- QCOMPARE(p.arg(QStringViewLiteral(arg1), QStringViewLiteral(arg2)), expected); \
+ QCOMPARE(p.arg(u"" arg1, QLatin1String(arg2)), expected); \
+ QCOMPARE(p.arg(QLatin1String(arg1), u"" arg2), expected); \
+ QCOMPARE(p.arg(u"" arg1, u"" arg2), expected); \
} while (false) \
/*end*/