diff options
author | Lars Knoll <lars.knoll@qt.io> | 2019-11-19 14:21:10 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-07-06 21:30:06 +0200 |
commit | a46caf087ca70a7482e065defa4d9547ae1335bd (patch) | |
tree | 4d112d89cdf9d57f5749ff0cbc638551f70d0caa /tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp | |
parent | 76004502baa118016c8e0f32895af7a822f1ba37 (diff) |
Simplify Q_ARRAY_LITERAL
And clean up some unused pieces of code.
Change-Id: I285b6862dc67b7130af66d3e08f652b1a56b990e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp')
-rw-r--r-- | tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp index 128bc51553..5be774cc53 100644 --- a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp +++ b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp @@ -1241,22 +1241,6 @@ void tst_QArrayData::literals() QCOMPARE(d.data()[i], wchar_t('A' + i)); } - { - SimpleVector<char> v = Q_ARRAY_LITERAL(char, "ABCDEFGHIJ"); - - QVERIFY(!v.isNull()); - QVERIFY(!v.isEmpty()); - QCOMPARE(v.size(), size_t(11)); - // v.capacity() is unspecified, for now - - QVERIFY(v.isStatic()); - QCOMPARE((void*)(const char*)(v.constBegin() + v.size()), (void*)(const char*)v.constEnd()); - - for (int i = 0; i < 10; ++i) - QCOMPARE(const_(v)[i], char('A' + i)); - QCOMPARE(const_(v)[10], char('\0')); - } - struct LiteralType { int value; Q_DECL_CONSTEXPR LiteralType(int v = 0) : value(v) {} @@ -1313,21 +1297,6 @@ void tst_QArrayData::variadicLiterals() QCOMPARE(d.data()[i][1], '\0'); } } - - { - SimpleVector<int> v = Q_ARRAY_LITERAL(int, 0, 1, 2, 3, 4, 5, 6); - - QVERIFY(!v.isNull()); - QVERIFY(!v.isEmpty()); - QCOMPARE(v.size(), size_t(7)); - // v.capacity() is unspecified, for now - - QVERIFY(v.isStatic()); - QCOMPARE((const int *)(v.constBegin() + v.size()), (const int *)v.constEnd()); - - for (int i = 0; i < 7; ++i) - QCOMPARE(const_(v)[i], i); - } } // std::remove_reference is in C++11, but requires library support |