diff options
author | Lars Knoll <lars.knoll@qt.io> | 2019-11-13 09:29:42 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2019-12-08 18:20:38 +0100 |
commit | 063e39df13dd53975d7d6615aa9f7e8429648aed (patch) | |
tree | c1413cf52d7b8bf3dc831875a102b2e63fdb7980 /tests/auto/corelib | |
parent | 7cc977759b84204427c1667e5b21ac75c3f7f5ab (diff) |
Get rid of QCharRef and QByteRef
We already detach immediately since change
c2d2757bccc68e1b981df059786c2e76f2969530. That basically removes
the main purpose of having QChar/ByteRef, and we can just as well
get rid of those classes for Qt 6.
Change-Id: I8dc566a1948ddc29c0cb8a77ec7310654a7219a4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/corelib')
3 files changed, 2 insertions, 26 deletions
diff --git a/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp index c6b3a796da..576b29f7a3 100644 --- a/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp +++ b/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp @@ -2003,7 +2003,7 @@ void tst_QByteArray::byteRefDetaching() const { { QByteArray str = "str"; - QByteArray copy; + QByteArray copy = str; copy[0] = 'S'; QCOMPARE(str, QByteArray("str")); diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp index ad31f9cefc..4f3ebe869d 100644 --- a/tests/auto/corelib/text/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp @@ -983,28 +983,6 @@ void tst_QString::acc_01() f[7]='F'; QCOMPARE(text[7],'!'); - a=""; - a[0]='A'; - QCOMPARE(a, QLatin1String("A")); - QCOMPARE(a.length(),1); - a[1]='B'; - QCOMPARE(a, QLatin1String("AB")); - QCOMPARE(a.length(),2); - a[2]='C'; - QCOMPARE(a, QLatin1String("ABC")); - QCOMPARE(a.length(),3); - a = QString(); - QVERIFY(a.isNull()); - a[0]='A'; - QCOMPARE(a, QLatin1String("A")); - QCOMPARE(a.length(),1); - a[1]='B'; - QCOMPARE(a, QLatin1String("AB")); - QCOMPARE(a.length(),2); - a[2]='C'; - QCOMPARE(a, QLatin1String("ABC")); - QCOMPARE(a.length(),3); - a="123"; b="456"; a[0]=a[1]; @@ -6415,7 +6393,7 @@ void tst_QString::QCharRefDetaching() const { { QString str = QString::fromLatin1("str"); - QString copy; + QString copy = str; copy[0] = QLatin1Char('S'); QCOMPARE(str, QString::fromLatin1("str")); diff --git a/tests/auto/corelib/tools/containerapisymmetry/tst_containerapisymmetry.cpp b/tests/auto/corelib/tools/containerapisymmetry/tst_containerapisymmetry.cpp index 7a1e13e83d..f6f10e9642 100644 --- a/tests/auto/corelib/tools/containerapisymmetry/tst_containerapisymmetry.cpp +++ b/tests/auto/corelib/tools/containerapisymmetry/tst_containerapisymmetry.cpp @@ -795,8 +795,6 @@ template <> QStringView make(int size) { return QStringView(s_string).left(siz template <> QLatin1String make(int size) { return QLatin1String("\1\2\3\4\5\6\7", size); } template <typename T> T clean(T &&t) { return std::forward<T>(t); } -inline QChar clean(QCharRef ch) { return ch; } -inline char clean(QByteRef ch) { return ch; } inline char clean(QLatin1Char ch) { return ch.toLatin1(); } template <typename Container> |