From d1612610e650ffd7f2fbdef535c431647f57f0ac Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Tue, 23 Jun 2020 10:04:16 +0200 Subject: Use QList instead of QVector in gui tests Task-number: QTBUG-84469 Change-Id: Ia86f39597de418dde6cd9ae3170ef919bd27416a Reviewed-by: Lars Knoll --- tests/auto/gui/image/qimage/tst_qimage.cpp | 16 ++-- .../gui/image/qimagewriter/tst_qimagewriter.cpp | 2 +- .../qstandarditemmodel/tst_qstandarditemmodel.cpp | 37 ++++---- tests/auto/gui/kernel/qkeyevent/tst_qkeyevent.cpp | 10 +- .../gui/kernel/qpixelformat/tst_qpixelformat.cpp | 4 +- .../gui/kernel/qtouchevent/tst_qtouchevent.cpp | 6 +- tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 4 +- tests/auto/gui/painting/qpainter/tst_qpainter.cpp | 30 +++--- .../gui/painting/qpainterpath/tst_qpainterpath.cpp | 2 +- tests/auto/gui/painting/qpolygon/tst_qpolygon.cpp | 27 +++--- tests/auto/gui/painting/qregion/tst_qregion.cpp | 85 +++++++++-------- tests/auto/gui/qopengl/tst_qopengl.cpp | 8 +- tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp | 2 +- tests/auto/gui/qvulkan/tst_qvulkan.cpp | 2 +- tests/auto/gui/rhi/qshader/tst_qshader.cpp | 6 +- tests/auto/gui/text/qcssparser/tst_qcssparser.cpp | 44 ++++----- tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp | 46 +++++----- tests/auto/gui/text/qrawfont/tst_qrawfont.cpp | 16 ++-- .../qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp | 16 ++-- .../gui/text/qtextdocument/tst_qtextdocument.cpp | 4 +- .../tst_qtextdocumentfragment.cpp | 4 +- .../auto/gui/text/qtextformat/tst_qtextformat.cpp | 4 +- .../qtextscriptengine/tst_qtextscriptengine.cpp | 32 +++---- tests/auto/gui/text/qzip/tst_qzip.cpp | 8 +- .../util/qshadergenerator/tst_qshadergenerator.cpp | 3 +- .../gui/util/qshadergraph/tst_qshadergraph.cpp | 101 ++++++++++----------- .../qshadergraphloader/tst_qshadergraphloader.cpp | 6 +- .../qshadernodesloader/tst_qshadernodesloader.cpp | 2 +- 28 files changed, 267 insertions(+), 260 deletions(-) diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp index f9e94d826c..c9c5b5b201 100644 --- a/tests/auto/gui/image/qimage/tst_qimage.cpp +++ b/tests/auto/gui/image/qimage/tst_qimage.cpp @@ -986,7 +986,7 @@ void tst_QImage::convertToFormat() void tst_QImage::convertToFormatWithColorTable() { - QVector colors(2); + QList colors(2); colors[0] = 0xFF000000; colors[1] = 0xFFFFFFFF; for (int format = QImage::Format_RGB32; format < QImage::Format_Alpha8; ++format) { @@ -1129,7 +1129,7 @@ void tst_QImage::rotate_data() QTest::addColumn("format"); QTest::addColumn("degrees"); - QVector degrees; + QList degrees; degrees << 0 << 90 << 180 << 270; foreach (int d, degrees) { @@ -1481,7 +1481,7 @@ void tst_QImage::convertToFormatPreserveText() QCOMPARE(imgResult1.text(), result); QCOMPARE(imgResult1.textKeys(), listResult); - QVector colorTable(4); + QList colorTable(4); for (int i = 0; i < 4; ++i) colorTable[i] = QRgb(42); QImage imgResult2 = img.convertToFormat(QImage::Format_MonoLSB, @@ -2187,7 +2187,7 @@ void tst_QImage::compareIndexed() { QImage img(256, 1, QImage::Format_Indexed8); - QVector colorTable(256); + QList colorTable(256); for (int i = 0; i < 256; ++i) colorTable[i] = qRgb(i, i, i); img.setColorTable(colorTable); @@ -2197,7 +2197,7 @@ void tst_QImage::compareIndexed() } QImage imgInverted(256, 1, QImage::Format_Indexed8); - QVector invertedColorTable(256); + QList invertedColorTable(256); for (int i = 0; i < 256; ++i) invertedColorTable[255-i] = qRgb(i, i, i); imgInverted.setColorTable(invertedColorTable); @@ -2290,7 +2290,7 @@ void tst_QImage::fillColor() QImage image(1, 1, format); if (image.depth() == 8) { - QVector table; + QList table; table << 0xff000000; table << 0xffffffff; table << 0xffff0000; @@ -2401,7 +2401,7 @@ void tst_QImage::rgbSwapped() QImage image(100, 1, format); image.fill(0); - QVector testColor(image.width()); + QList testColor(image.width()); for (int i = 0; i < image.width(); ++i) testColor[i] = QColor(i, 10 + i, 20 + i * 2, 30 + i); @@ -2569,7 +2569,7 @@ void tst_QImage::inplaceRgbSwapped() QImage image(64, 1, format); image.fill(0); - QVector testColor(image.width()); + QList testColor(image.width()); for (int i = 0; i < image.width(); ++i) testColor[i] = qRgb(i * 2, i * 3, 255 - i * 4); diff --git a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp index b76ccf3ed0..ea11768a4b 100644 --- a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp +++ b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp @@ -47,7 +47,7 @@ #include typedef QMap QStringMap; -typedef QVector QIntList; +typedef QList QIntList; Q_DECLARE_METATYPE(QImageWriter::ImageWriterError) Q_DECLARE_METATYPE(QImage::Format) diff --git a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp index 04a3fe7a62..038e82f539 100644 --- a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp +++ b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp @@ -138,10 +138,10 @@ private slots: private: QStandardItemModel *m_model = nullptr; QPersistentModelIndex persistent; - QVector rcParent = QVector(8); - QVector rcFirst = QVector(8, 0); - QVector rcLast = QVector(8, 0); - QVector currentRoles; + QList rcParent = QList(8); + QList rcFirst = QList(8, 0); + QList rcLast = QList(8, 0); + QList currentRoles; //return true if models have the same structure, and all child have the same text static bool compareModels(QStandardItemModel *model1, QStandardItemModel *model2); @@ -193,11 +193,10 @@ void tst_QStandardItemModel::init() connect(m_model, &QStandardItemModel::columnsRemoved, this, &tst_QStandardItemModel::columnsRemoved); - connect(m_model, &QAbstractItemModel::dataChanged, - this, [this](const QModelIndex &, const QModelIndex &, const QVector &roles) - { - currentRoles = roles; - }); + connect(m_model, &QAbstractItemModel::dataChanged, this, + [this](const QModelIndex &, const QModelIndex &, const QList &roles) { + currentRoles = roles; + }); rcFirst.fill(-1); rcLast.fill(-1); @@ -723,17 +722,17 @@ void tst_QStandardItemModel::data() currentRoles.clear(); // bad args m_model->setData(QModelIndex(), "bla", Qt::DisplayRole); - QCOMPARE(currentRoles, QVector{}); + QCOMPARE(currentRoles, QList {}); QIcon icon; for (int r = 0; r < m_model->rowCount(); ++r) { for (int c = 0; c < m_model->columnCount(); ++c) { m_model->setData(m_model->index(r,c), "initialitem", Qt::DisplayRole); - QCOMPARE(currentRoles, QVector({Qt::DisplayRole, Qt::EditRole})); + QCOMPARE(currentRoles, QList({ Qt::DisplayRole, Qt::EditRole })); m_model->setData(m_model->index(r,c), "tooltip", Qt::ToolTipRole); - QCOMPARE(currentRoles, QVector{Qt::ToolTipRole}); + QCOMPARE(currentRoles, QList { Qt::ToolTipRole }); m_model->setData(m_model->index(r,c), icon, Qt::DecorationRole); - QCOMPARE(currentRoles, QVector{Qt::DecorationRole}); + QCOMPARE(currentRoles, QList { Qt::DecorationRole }); } } @@ -750,7 +749,7 @@ void tst_QStandardItemModel::clearItemData() { currentRoles.clear(); QVERIFY(!m_model->clearItemData(QModelIndex())); - QCOMPARE(currentRoles, QVector{}); + QCOMPARE(currentRoles, QList {}); const QModelIndex idx = m_model->index(0, 0); const QMap oldData = m_model->itemData(idx); m_model->setData(idx, QLatin1String("initialitem"), Qt::DisplayRole); @@ -762,7 +761,7 @@ void tst_QStandardItemModel::clearItemData() QCOMPARE(idx.data(Qt::ToolTipRole), QVariant()); QCOMPARE(idx.data(Qt::DisplayRole), QVariant()); QCOMPARE(idx.data(Qt::EditRole), QVariant()); - QCOMPARE(currentRoles, QVector{}); + QCOMPARE(currentRoles, QList {}); m_model->setItemData(idx, oldData); currentRoles.clear(); } @@ -1561,8 +1560,8 @@ void tst_QStandardItemModel::removeRowsAndColumns() for (int r = 0; r < row_list.count(); r++) \ QCOMPARE(model.item(r,c)->text() , row_list[r] + QLatin1Char('x') + col_list[c]); - QVector row_list = QString("1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20").split(',').toVector(); - QVector col_list = row_list; + QStringList row_list = QString("1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20").split(','); + QStringList col_list = row_list; QStandardItemModel model; for (int c = 0; c < col_list.count(); c++) for (int r = 0; r < row_list.count(); r++) @@ -1608,8 +1607,8 @@ void tst_QStandardItemModel::defaultItemRoles() void tst_QStandardItemModel::itemRoleNames() { - QVector row_list = QString("1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20").split(',').toVector(); - QVector col_list = row_list; + QStringList row_list = QString("1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20").split(','); + QStringList col_list = row_list; QStandardItemModel model; for (int c = 0; c < col_list.count(); c++) for (int r = 0; r < row_list.count(); r++) diff --git a/tests/auto/gui/kernel/qkeyevent/tst_qkeyevent.cpp b/tests/auto/gui/kernel/qkeyevent/tst_qkeyevent.cpp index 6a928cac7a..66160df21b 100644 --- a/tests/auto/gui/kernel/qkeyevent/tst_qkeyevent.cpp +++ b/tests/auto/gui/kernel/qkeyevent/tst_qkeyevent.cpp @@ -52,7 +52,7 @@ private: } public: - QVector keyEvents; + QList keyEvents; }; class tst_QKeyEvent : public QObject @@ -98,7 +98,7 @@ void tst_QKeyEvent::basicEventDelivery() } } -static bool orderByModifier(const QVector &v1, const QVector &v2) +static bool orderByModifier(const QList &v1, const QList &v2) { if (v1.size() != v2.size()) return v1.size() < v2.size(); @@ -146,12 +146,12 @@ void tst_QKeyEvent::modifiers_data() { Qt::Key_Meta, Qt::MetaModifier }, }; - QVector> modifierCombinations; + QList> modifierCombinations; // Generate powerset (minus the empty set) of possible modifier combinations static const int kNumModifiers = sizeof(modifiers) / sizeof(Modifier); for (quint64 bitmask = 1; bitmask < (1 << kNumModifiers) ; ++bitmask) { - QVector modifierCombination; + QList modifierCombination; for (quint64 modifier = 0; modifier < kNumModifiers; ++modifier) { if (bitmask & (quint64(1) << modifier)) modifierCombination.append(modifier); @@ -162,7 +162,7 @@ void tst_QKeyEvent::modifiers_data() std::sort(modifierCombinations.begin(), modifierCombinations.end(), orderByModifier); QTest::addColumn("modifiers"); - foreach (const QVector combination, modifierCombinations) { + foreach (const QList combination, modifierCombinations) { int keys[4] = {}; Qt::KeyboardModifiers mods; for (int i = 0; i < combination.size(); ++i) { diff --git a/tests/auto/gui/kernel/qpixelformat/tst_qpixelformat.cpp b/tests/auto/gui/kernel/qpixelformat/tst_qpixelformat.cpp index c02d7cd165..14d2b74491 100644 --- a/tests/auto/gui/kernel/qpixelformat/tst_qpixelformat.cpp +++ b/tests/auto/gui/kernel/qpixelformat/tst_qpixelformat.cpp @@ -56,8 +56,8 @@ void tst_QPixelFormat::testOperators() void tst_QPixelFormat::testQVectorOfFormats() { - QVector reallocedVector; - QVector reservedVector; + QList reallocedVector; + QList reservedVector; reservedVector.reserve(QImage::NImageFormats); for (int i = 0; i < QImage::NImageFormats; i++) { if (i == 0 || i == 2) // skip invalid and monolsb diff --git a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp index 7be68dd699..bffa41b8a8 100644 --- a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp +++ b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp @@ -625,7 +625,7 @@ void tst_QTouchEvent::basicRawEventTranslation() rawTouchPoint.setState(Qt::TouchPointPressed); rawTouchPoint.setScreenPos(screenPos); rawTouchPoint.setNormalizedPos(normalized(rawTouchPoint.position(), screenGeometry)); - QVector rawPosList; + QList rawPosList; rawPosList << QPointF(12, 34) << QPointF(56, 78); rawTouchPoint.setRawScreenPositions(rawPosList); const ulong timestamp = 1234; @@ -977,7 +977,7 @@ void tst_QTouchEvent::touchOnMultipleTouchscreens() QPointF delta(10, 10); QRectF screenGeometry = touchWidget.screen()->geometry(); - QVector rawTouchPoints(3); + QList rawTouchPoints(3); rawTouchPoints[0].setId(1); rawTouchPoints[1].setId(10); rawTouchPoints[2].setId(11); @@ -1361,7 +1361,7 @@ void tst_QTouchEvent::basicRawEventTranslationOfIds() QPointF delta(10, 10); QRectF screenGeometry = touchWidget.screen()->geometry(); - QVector rawPosList; + QList rawPosList; rawPosList << QPointF(12, 34) << QPointF(56, 78); QList rawTouchPoints; diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index 05f58f769f..8e5a0fba8f 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -343,12 +343,12 @@ public: return m_surfaceventType; } - QVector m_framePositionsOnMove; + QList m_framePositionsOnMove; Qt::WindowStates lastReceivedWindowState; private: QHash m_received; - QVector m_order; + QList m_order; QRegion m_exposeRegion; QPlatformSurfaceEvent::SurfaceEventType m_surfaceventType; }; diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp index b593c357dd..060c22c1b4 100644 --- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp +++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp @@ -1764,7 +1764,7 @@ void tst_QPainter::setEqualClipRegionAndPath_data() QTest::newRow("simple rect") << QSize(100, 100) << QRegion(QRect(5, 5, 10, 10)); - QVector rects; + QList rects; QRegion region; rects << QRect(5, 5, 10, 10) << QRect(20, 20, 10, 10); @@ -2065,7 +2065,7 @@ void tst_QPainter::clippedLines_data() QPen pen2(QColor(223, 223, 0, 223)); pen2.setWidth(2); - QVector lines; + QList lines; lines << QLineF(15, 15, 65, 65) << QLineF(14, 14, 66, 66) << QLineF(16, 16, 64, 64) @@ -3239,7 +3239,7 @@ bool verifyOutlineFillConsistency(const QImage &img, QRgb outside, QRgb inside, QQueue discovered; discovered.enqueue(QPoint(x, y)); - QVector visited(img.width() * img.height()); + QList visited(img.width() * img.height()); visited.fill(false); while (!discovered.isEmpty()) { @@ -4023,7 +4023,7 @@ void tst_QPainter::inactivePainter() QPainter p; QPainterPath path; QRegion region(QRect(20, 20, 60, 40)); - QPolygonF polygon(QVector() << QPointF(0, 0) << QPointF(12, 0) << QPointF(8, 6)); + QPolygonF polygon(QList() << QPointF(0, 0) << QPointF(12, 0) << QPointF(8, 6)); path.addPolygon(polygon); p.save(); @@ -4666,7 +4666,7 @@ void tst_QPainter::QTBUG17053_zeroDashPattern() QImage original = image; - QVector pattern; + QList pattern; pattern << qreal(0) << qreal(0); QPainter p(&image); @@ -4788,7 +4788,7 @@ void tst_QPainter::QTBUG25153_drawLine() { QImage image(2, 2, QImage::Format_RGB32); - QVector styles; + QList styles; styles << Qt::FlatCap << Qt::SquareCap << Qt::RoundCap; foreach (Qt::PenCapStyle style, styles) { @@ -5045,17 +5045,23 @@ void tst_QPainter::drawTextNoHinting() void tst_QPainter::drawPolyline_data() { - QTest::addColumn< QVector >("points"); + QTest::addColumn>("points"); - QTest::newRow("basic") << (QVector() << QPointF(10, 10) << QPointF(20, 10) << QPointF(20, 20)); - QTest::newRow("clipped") << (QVector() << QPoint(-10, 100) << QPoint(-1, 100) << QPoint(-1, -2) << QPoint(100, -2) << QPoint(100, 40)); // QTBUG-31579 - QTest::newRow("shortsegment") << (QVector() << QPoint(20, 100) << QPoint(20, 99) << QPoint(21, 99) << QPoint(21, 104)); // QTBUG-42398 - QTest::newRow("edge") << (QVector() << QPointF(4.5, 121.6) << QPointF(9.4, 150.9) << QPointF(14.2, 184.8) << QPointF(19.1, 130.4)); + QTest::newRow("basic") << (QList() + << QPointF(10, 10) << QPointF(20, 10) << QPointF(20, 20)); + QTest::newRow("clipped") << (QList() + << QPoint(-10, 100) << QPoint(-1, 100) << QPoint(-1, -2) + << QPoint(100, -2) << QPoint(100, 40)); // QTBUG-31579 + QTest::newRow("shortsegment") << (QList() + << QPoint(20, 100) << QPoint(20, 99) << QPoint(21, 99) + << QPoint(21, 104)); // QTBUG-42398 + QTest::newRow("edge") << (QList() << QPointF(4.5, 121.6) << QPointF(9.4, 150.9) + << QPointF(14.2, 184.8) << QPointF(19.1, 130.4)); } void tst_QPainter::drawPolyline() { - QFETCH(QVector, points); + QFETCH(QList, points); QImage images[2]; for (int r = 0; r < 2; r++) { diff --git a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp index 86a8965cec..161ff5d3b7 100644 --- a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp +++ b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp @@ -1345,7 +1345,7 @@ void tst_QPainterPath::translate() shape -= QRect(225, 175, 50, 50); QPainterPath complexPath; complexPath.addRegion(shape); - QVector untranslatedElements; + QList untranslatedElements; for (int i = 0; i < complexPath.elementCount(); ++i) untranslatedElements.append(QPointF(complexPath.elementAt(i))); diff --git a/tests/auto/gui/painting/qpolygon/tst_qpolygon.cpp b/tests/auto/gui/painting/qpolygon/tst_qpolygon.cpp index bf3e5dfb52..2187c1f141 100644 --- a/tests/auto/gui/painting/qpolygon/tst_qpolygon.cpp +++ b/tests/auto/gui/painting/qpolygon/tst_qpolygon.cpp @@ -154,8 +154,9 @@ void tst_QPolygon::makeEllipse() void tst_QPolygon::swap() { - QPolygon p1(QVector() << QPoint(0,0) << QPoint(10,10) << QPoint(-10,10)); - QPolygon p2(QVector() << QPoint(0,0) << QPoint( 0,10) << QPoint( 10,10) << QPoint(10,0)); + QPolygon p1(QList() << QPoint(0, 0) << QPoint(10, 10) << QPoint(-10, 10)); + QPolygon p2(QList() << QPoint(0, 0) << QPoint(0, 10) << QPoint(10, 10) + << QPoint(10, 0)); p1.swap(p2); QCOMPARE(p1.count(),4); QCOMPARE(p2.count(),3); @@ -169,23 +170,27 @@ void tst_QPolygon::intersections_data() QTest::newRow("empty intersects nothing") << QPolygon() - << QPolygon(QVector() << QPoint(0,0) << QPoint(10,10) << QPoint(-10,10)) + << QPolygon(QList() << QPoint(0, 0) << QPoint(10, 10) << QPoint(-10, 10)) << false; QTest::newRow("identical triangles") - << QPolygon(QVector() << QPoint(0,0) << QPoint(10,10) << QPoint(-10,10)) - << QPolygon(QVector() << QPoint(0,0) << QPoint(10,10) << QPoint(-10,10)) + << QPolygon(QList() << QPoint(0, 0) << QPoint(10, 10) << QPoint(-10, 10)) + << QPolygon(QList() << QPoint(0, 0) << QPoint(10, 10) << QPoint(-10, 10)) << true; QTest::newRow("not intersecting") - << QPolygon(QVector() << QPoint(0,0) << QPoint(10,10) << QPoint(-10,10)) - << QPolygon(QVector() << QPoint(0,20) << QPoint(10,12) << QPoint(-10,12)) + << QPolygon(QList() << QPoint(0, 0) << QPoint(10, 10) << QPoint(-10, 10)) + << QPolygon(QList() << QPoint(0, 20) << QPoint(10, 12) << QPoint(-10, 12)) << false; QTest::newRow("clean intersection of squares") - << QPolygon(QVector() << QPoint(0,0) << QPoint(0,10) << QPoint(10,10) << QPoint(10,0)) - << QPolygon(QVector() << QPoint(5,5) << QPoint(5,15) << QPoint(15,15) << QPoint(15,5)) + << QPolygon(QList() + << QPoint(0, 0) << QPoint(0, 10) << QPoint(10, 10) << QPoint(10, 0)) + << QPolygon(QList() + << QPoint(5, 5) << QPoint(5, 15) << QPoint(15, 15) << QPoint(15, 5)) << true; QTest::newRow("clean contains of squares") - << QPolygon(QVector() << QPoint(0,0) << QPoint(0,10) << QPoint(10,10) << QPoint(10,0)) - << QPolygon(QVector() << QPoint(5,5) << QPoint(5,8) << QPoint(8,8) << QPoint(8,5)) + << QPolygon(QList() + << QPoint(0, 0) << QPoint(0, 10) << QPoint(10, 10) << QPoint(10, 0)) + << QPolygon(QList() + << QPoint(5, 5) << QPoint(5, 8) << QPoint(8, 8) << QPoint(8, 5)) << true; } diff --git a/tests/auto/gui/painting/qregion/tst_qregion.cpp b/tests/auto/gui/painting/qregion/tst_qregion.cpp index 3aa556f2a8..92b265197e 100644 --- a/tests/auto/gui/painting/qregion/tst_qregion.cpp +++ b/tests/auto/gui/painting/qregion/tst_qregion.cpp @@ -298,25 +298,24 @@ void tst_QRegion::emptyPolygonRegion_data() QTest::addColumn("pa"); QTest::addColumn("isEmpty"); QTest::addColumn("numRects"); - QTest::addColumn >("rects"); + QTest::addColumn>("rects"); QPolygon pa; - - QTest::newRow("no points") << pa << true << 0 << QVector(); + QTest::newRow("no points") << pa << true << 0 << QList(); pa = QPolygon() << QPoint(10,10); - QTest::newRow("one point") << pa << true << 0 << QVector(); + QTest::newRow("one point") << pa << true << 0 << QList(); pa = QPolygon() << QPoint(10,10) << QPoint(10,20); - QTest::newRow("two points, horizontal") << pa << true << 0 << QVector(); + QTest::newRow("two points, horizontal") << pa << true << 0 << QList(); pa = QPolygon() << QPoint(10,10) << QPoint(20,10); - QTest::newRow("two points, vertical") << pa << true << 0 << QVector(); + QTest::newRow("two points, vertical") << pa << true << 0 << QList(); pa = QPolygon() << QPoint(10,10) << QPoint(20,20); - QTest::newRow("two points, diagonal") << pa << true << 0 << QVector(); + QTest::newRow("two points, diagonal") << pa << true << 0 << QList(); pa = QPolygon() << QPoint(10,10) << QPoint(15,15) << QPoint(10,15) << QPoint(10, 10) ; - QVector v; + QList v; v << QRect(10,11,1, 1) << QRect(10,12,2,1) << QRect(10,13,3,1) << QRect(10,14,4,1); QTest::newRow("triangle") << pa << false << 4 << v; @@ -334,7 +333,7 @@ void tst_QRegion::emptyPolygonRegion() QRegion r(pa); QTEST(r.isEmpty(), "isEmpty"); QTEST(int(std::distance(r.begin(), r.end())), "numRects"); - QVector rects; + QList rects; std::copy(r.begin(), r.end(), std::back_inserter(rects)); QTEST(rects.size(), "numRects"); QTEST(rects, "rects"); @@ -504,7 +503,7 @@ void tst_QRegion::operator_plus_data() << QRegion(QRect(10, 10, 10, 10)); QRegion expected; - QVector rects; + QList rects; rects << QRect(10, 10, 10, 10) << QRect(22, 10, 10, 10); expected.setRects(rects.constData(), rects.size()); QTest::newRow("non overlapping") << QRegion(10, 10, 10, 10) @@ -650,7 +649,7 @@ void tst_QRegion::operator_minus_data() << QRegion(QRect(10, 10, 10, 10)); QRegion dest; - QVector rects; + QList rects; rects << QRect(10, 10, 10, 10) << QRect(22, 10, 10, 10); dest.setRects(rects.constData(), rects.size()); QTest::newRow("simple 1") << dest @@ -705,7 +704,7 @@ void tst_QRegion::operator_intersect_data() << QRegion(); QRegion dest; - QVector rects; + QList rects; rects << QRect(10, 10, 10, 10) << QRect(22, 10, 10, 10); dest.setRects(rects.constData(), rects.size()); QTest::newRow("simple 1") << dest @@ -787,7 +786,7 @@ void tst_QRegion::operator_xor_data() << QRegion(QRect(10, 10, 10, 10)); QRegion dest; - QVector rects; + QList rects; rects << QRect(10, 10, 10, 10) << QRect(22, 10, 10, 10); dest.setRects(rects.constData(), rects.size()); QTest::newRow("simple 1") << dest @@ -838,7 +837,7 @@ void tst_QRegion::rectCount_data() QTest::newRow("rect") << QRegion(10, 10, 10, 10) << 1; QRegion dest; - QVector rects; + QList rects; rects << QRect(10, 10, 10, 10) << QRect(22, 10, 10, 10); dest.setRects(rects.constData(), rects.size()); @@ -859,7 +858,7 @@ void tst_QRegion::isEmpty_data() QTest::newRow("QRegion") << QRegion(); - QVector rects; + QList rects; rects << QRect(0, 0, 10, 10) << QRect(15, 0, 10, 10); QRegion r1; r1.setRects(rects.constData(), rects.size()); @@ -918,40 +917,38 @@ void tst_QRegion::regionFromPath() void tst_QRegion::scaleRegions_data() { QTest::addColumn("scale"); - QTest::addColumn>("inputRects"); - QTest::addColumn>("expectedRects"); - - QTest::newRow("1.0 single") << 1.0 - << QVector{ QRect(10, 10, 20, 20) } - << QVector{ QRect(10, 10, 20, 20) }; - QTest::newRow("1.0 multi") << 1.0 - << QVector{ QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) } - << QVector{ QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) }; - QTest::newRow("2.0 single") << 2.0 - << QVector{ QRect(10, 10, 20, 20) } - << QVector{ QRect(20, 20, 40, 40) }; - QTest::newRow("2.0 multi") << 2.0 - << QVector{ QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) } - << QVector{ QRect(20, 20, 40, 40), QRect(80, 20, 40, 40) }; - QTest::newRow("-1.0 single") << -1.0 - << QVector{ QRect(10, 10, 20, 20) } - << QVector{ QRect(-30, -30, 20, 20) }; - QTest::newRow("-1.0 multi") << -1.0 - << QVector{ QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) } - << QVector{ QRect(-60, -30, 20, 20), QRect(-30, -30, 20, 20) }; - QTest::newRow("-2.0 single") << -2.0 - << QVector{ QRect(10, 10, 20, 20) } - << QVector{ QRect(-60, -60, 40, 40) }; - QTest::newRow("-2.0 multi") << -2.0 - << QVector{ QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) } - << QVector{ QRect(-120, -60, 40, 40), QRect(-60, -60, 40, 40) }; + QTest::addColumn>("inputRects"); + QTest::addColumn>("expectedRects"); + + QTest::newRow("1.0 single") << 1.0 << QList { QRect(10, 10, 20, 20) } + << QList { QRect(10, 10, 20, 20) }; + QTest::newRow("1.0 multi") << 1.0 + << QList { QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) } + << QList { QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) }; + QTest::newRow("2.0 single") << 2.0 << QList { QRect(10, 10, 20, 20) } + << QList { QRect(20, 20, 40, 40) }; + QTest::newRow("2.0 multi") << 2.0 + << QList { QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) } + << QList { QRect(20, 20, 40, 40), QRect(80, 20, 40, 40) }; + QTest::newRow("-1.0 single") << -1.0 << QList { QRect(10, 10, 20, 20) } + << QList { QRect(-30, -30, 20, 20) }; + QTest::newRow("-1.0 multi") << -1.0 + << QList { QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) } + << QList { QRect(-60, -30, 20, 20), + QRect(-30, -30, 20, 20) }; + QTest::newRow("-2.0 single") << -2.0 << QList { QRect(10, 10, 20, 20) } + << QList { QRect(-60, -60, 40, 40) }; + QTest::newRow("-2.0 multi") << -2.0 + << QList { QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) } + << QList { QRect(-120, -60, 40, 40), + QRect(-60, -60, 40, 40) }; } void tst_QRegion::scaleRegions() { QFETCH(qreal, scale); - QFETCH(QVector, inputRects); - QFETCH(QVector, expectedRects); + QFETCH(QList, inputRects); + QFETCH(QList, expectedRects); QRegion region; region.setRects(inputRects.constData(), inputRects.size()); diff --git a/tests/auto/gui/qopengl/tst_qopengl.cpp b/tests/auto/gui/qopengl/tst_qopengl.cpp index 7236c22fd0..c093885951 100644 --- a/tests/auto/gui/qopengl/tst_qopengl.cpp +++ b/tests/auto/gui/qopengl/tst_qopengl.cpp @@ -834,7 +834,7 @@ void tst_QOpenGL::fboMRT() { // 3 color attachments, different sizes, same internal format, no depth/stencil. - QVector sizes; + QList sizes; sizes << QSize(128, 128) << QSize(192, 128) << QSize(432, 123); QOpenGLFramebufferObject fbo(sizes[0]); fbo.addColorAttachment(sizes[1]); @@ -882,7 +882,7 @@ void tst_QOpenGL::fboMRT() { // 2 color attachments, same size, same internal format, depth/stencil. - QVector sizes; + QList sizes; sizes.fill(QSize(128, 128), 2); QOpenGLFramebufferObject fbo(sizes[0], QOpenGLFramebufferObject::CombinedDepthStencil); fbo.addColorAttachment(sizes[1]); @@ -922,11 +922,11 @@ void tst_QOpenGL::fboMRT_differentFormats() QSKIP("RGB10_A2 not supported on this platform"); // 3 color attachments, same size, different internal format, depth/stencil. - QVector sizes; + QList sizes; sizes.fill(QSize(128, 128), 3); QOpenGLFramebufferObjectFormat format; format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil); - QVector internalFormats; + QList internalFormats; internalFormats << GL_RGBA8 << GL_RGB10_A2 << GL_RGB5_A1; format.setInternalTextureFormat(internalFormats[0]); QOpenGLFramebufferObject fbo(sizes[0], format); diff --git a/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp b/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp index b72ba3c32b..a641a3adba 100644 --- a/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp +++ b/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp @@ -249,7 +249,7 @@ void tst_QOpenGlConfig::testBugList() expectedFeatures << "feature1"; // adapter info - QVersionNumber driverVersion(QVector() << 9 << 18 << 13 << 4460); + QVersionNumber driverVersion(QList() << 9 << 18 << 13 << 4460); QOpenGLConfig::Gpu gpu = QOpenGLConfig::Gpu::fromDevice(0x10DE, 0x0DE9, driverVersion, QByteArrayLiteral("Unknown")); QSet actualFeatures = QOpenGLConfig::gpuFeatures(gpu, QStringLiteral("win"), diff --git a/tests/auto/gui/qvulkan/tst_qvulkan.cpp b/tests/auto/gui/qvulkan/tst_qvulkan.cpp index 3315ae5225..f200ec6ba4 100644 --- a/tests/auto/gui/qvulkan/tst_qvulkan.cpp +++ b/tests/auto/gui/qvulkan/tst_qvulkan.cpp @@ -197,7 +197,7 @@ void tst_QVulkan::vulkanWindow() w.hide(); waitForUnexposed(&w); w.setVulkanInstance(&inst); - QVector pdevs = w.availablePhysicalDevices(); + QList pdevs = w.availablePhysicalDevices(); if (pdevs.isEmpty()) QSKIP("No Vulkan physical devices; skip"); w.show(); diff --git a/tests/auto/gui/rhi/qshader/tst_qshader.cpp b/tests/auto/gui/rhi/qshader/tst_qshader.cpp index d12efa90dc..602a355cd9 100644 --- a/tests/auto/gui/rhi/qshader/tst_qshader.cpp +++ b/tests/auto/gui/rhi/qshader/tst_qshader.cpp @@ -266,7 +266,7 @@ void tst_QShader::mslResourceMapping() QVERIFY(s.isValid()); QCOMPARE(QShaderPrivate::get(&s)->qsbVersion, 2); - const QVector availableShaders = s.availableShaders(); + const QList availableShaders = s.availableShaders(); QCOMPARE(availableShaders.count(), 7); QVERIFY(availableShaders.contains(QShaderKey(QShader::SpirvShader, QShaderVersion(100)))); QVERIFY(availableShaders.contains(QShaderKey(QShader::MslShader, QShaderVersion(12)))); @@ -298,7 +298,7 @@ void tst_QShader::loadV3() QVERIFY(s.isValid()); QCOMPARE(QShaderPrivate::get(&s)->qsbVersion, 3); - const QVector availableShaders = s.availableShaders(); + const QList availableShaders = s.availableShaders(); QCOMPARE(availableShaders.count(), 7); QVERIFY(availableShaders.contains(QShaderKey(QShader::SpirvShader, QShaderVersion(100)))); QVERIFY(availableShaders.contains(QShaderKey(QShader::MslShader, QShaderVersion(12)))); @@ -461,7 +461,7 @@ void tst_QShader::loadV4() QVERIFY(s.isValid()); QCOMPARE(QShaderPrivate::get(&s)->qsbVersion, 4); - const QVector availableShaders = s.availableShaders(); + const QList availableShaders = s.availableShaders(); QCOMPARE(availableShaders.count(), 7); QVERIFY(availableShaders.contains(QShaderKey(QShader::SpirvShader, QShaderVersion(100)))); QVERIFY(availableShaders.contains(QShaderKey(QShader::MslShader, QShaderVersion(12)))); diff --git a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp index 1e2bb72ddd..a01805236a 100644 --- a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp +++ b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp @@ -148,7 +148,7 @@ static const char *tokenName(QCss::TokenType t) return ""; } -static void debug(const QVector &symbols, int index = -1) +static void debug(const QList &symbols, int index = -1) { qDebug() << "all symbols:"; for (int i = 0; i < symbols.count(); ++i) @@ -166,7 +166,7 @@ void tst_QCssParser::scanner() QFile inputFile(input); QVERIFY(inputFile.open(QIODevice::ReadOnly|QIODevice::Text)); - QVector symbols; + QList symbols; QCss::Scanner::scan(QCss::Scanner::preprocess(QString::fromUtf8(inputFile.readAll())), &symbols); QVERIFY(symbols.count() > 1); @@ -343,9 +343,9 @@ void tst_QCssParser::expr_data() { QTest::addColumn("parseSuccess"); QTest::addColumn("css"); - QTest::addColumn >("expectedValues"); + QTest::addColumn>("expectedValues"); - QVector values; + QList values; QCss::Value val; QCss::Value comma; @@ -368,10 +368,10 @@ void tst_QCssParser::expr() { QFETCH(bool, parseSuccess); QFETCH(QString, css); - QFETCH(QVector, expectedValues); + QFETCH(QList, expectedValues); QCss::Parser parser(css); - QVector values; + QList values; QVERIFY(parser.testExpr()); QCOMPARE(parser.parseExpr(&values), parseSuccess); if (parseSuccess) { @@ -983,8 +983,8 @@ void tst_QCssParser::marginValue() QDomElement e = doc.documentElement().firstChildElement(); QCss::StyleSelector::NodePtr n; n.ptr = &e; - QVector rules = testSelector.styleRulesForNode(n); - QVector decls = rules.at(0).declarations; + QList rules = testSelector.styleRulesForNode(n); + QList decls = rules.at(0).declarations; QCss::ValueExtractor v(decls); { @@ -1162,7 +1162,7 @@ void tst_QCssParser::styleSelector() QVERIFY(!e.isNull()); QCss::StyleSelector::NodePtr n; n.ptr = &e; - QVector decls = testSelector.declarationsForNode(n); + QList decls = testSelector.declarationsForNode(n); if (match) { QCOMPARE(decls.count(), 1); @@ -1258,7 +1258,7 @@ void tst_QCssParser::specificitySort() QDomElement e = doc.documentElement().firstChildElement(); QCss::StyleSelector::NodePtr n; n.ptr = &e; - QVector decls = testSelector.declarationsForNode(n); + QList decls = testSelector.declarationsForNode(n); QCOMPARE(decls.count(), 2); @@ -1340,9 +1340,9 @@ void tst_QCssParser::rulesForNode() QDomElement e = doc.documentElement().firstChildElement(); QCss::StyleSelector::NodePtr n; n.ptr = &e; - QVector rules = testSelector.styleRulesForNode(n); + QList rules = testSelector.styleRulesForNode(n); - QVector decls; + QList decls; for (int i = 0; i < rules.count(); i++) { const QCss::Selector &selector = rules.at(i).selectors.at(0); quint64 negated = 0; @@ -1398,8 +1398,8 @@ void tst_QCssParser::shorthandBackgroundProperty() QDomElement e = doc.documentElement().firstChildElement(); QCss::StyleSelector::NodePtr n; n.ptr = &e; - QVector rules = testSelector.styleRulesForNode(n); - QVector decls = rules.at(0).declarations; + QList rules = testSelector.styleRulesForNode(n); + QList decls = rules.at(0).declarations; QCss::ValueExtractor v(decls); QBrush brush; @@ -1477,8 +1477,8 @@ void tst_QCssParser::pseudoElement() QDomElement e = doc.documentElement().firstChildElement(); QCss::StyleSelector::NodePtr n; n.ptr = &e; - QVector rules = testSelector.styleRulesForNode(n); - QVector decls; + QList rules = testSelector.styleRulesForNode(n); + QList decls; for (int i = 0; i < rules.count(); i++) { const QCss::Selector& selector = rules.at(i).selectors.at(0); if (pseudoElement.compare(selector.pseudoElement(), Qt::CaseInsensitive) != 0) @@ -1564,8 +1564,8 @@ void tst_QCssParser::gradient() QDomElement e = doc.documentElement().firstChildElement(); QCss::StyleSelector::NodePtr n; n.ptr = &e; - QVector rules = testSelector.styleRulesForNode(n); - QVector decls = rules.at(0).declarations; + QList rules = testSelector.styleRulesForNode(n); + QList decls = rules.at(0).declarations; QCss::ValueExtractor ve(decls); QBrush fg, sfg; QBrush sbg, abg; @@ -1624,7 +1624,7 @@ void tst_QCssParser::extractFontFamily() QCss::StyleRule rule = (!sheet.styleRules.isEmpty()) ? sheet.styleRules.at(0) : *sheet.nameIndex.begin(); - const QVector decls = rule.declarations; + const QList decls = rule.declarations; QVERIFY(!decls.isEmpty()); QCss::ValueExtractor extractor(decls); @@ -1681,7 +1681,7 @@ void tst_QCssParser::extractBorder() QCOMPARE(sheet.styleRules.count() + sheet.nameIndex.count(), 1); QCss::StyleRule rule = (!sheet.styleRules.isEmpty()) ? sheet.styleRules.at(0) : *sheet.nameIndex.begin(); - const QVector decls = rule.declarations; + const QList decls = rule.declarations; QVERIFY(!decls.isEmpty()); QCss::ValueExtractor extractor(decls); @@ -1711,7 +1711,7 @@ void tst_QCssParser::noTextDecoration() QCOMPARE(sheet.styleRules.count() + sheet.nameIndex.count(), 1); QCss::StyleRule rule = (!sheet.styleRules.isEmpty()) ? sheet.styleRules.at(0) : *sheet.nameIndex.begin(); - const QVector decls = rule.declarations; + const QList decls = rule.declarations; QVERIFY(!decls.isEmpty()); QCss::ValueExtractor extractor(decls); @@ -1736,7 +1736,7 @@ void tst_QCssParser::quotedAndUnquotedIdentifiers() QCOMPARE(sheet.styleRules.count() + sheet.nameIndex.count(), 1); QCss::StyleRule rule = (!sheet.styleRules.isEmpty()) ? sheet.styleRules.at(0) : *sheet.nameIndex.begin(); - const QVector decls = rule.declarations; + const QList decls = rule.declarations; QCOMPARE(decls.size(), 2); QCOMPARE(decls.at(0).d->values.first().type, QCss::Value::String); diff --git a/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp index cc04d86389..2be683ed13 100644 --- a/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp +++ b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp @@ -110,8 +110,8 @@ static QGlyphRun make_dummy_indexes() { QGlyphRun glyphs; - QVector glyphIndexes; - QVector positions; + QList glyphIndexes; + QList positions; QFont font; font.setPointSize(18); @@ -135,8 +135,8 @@ void tst_QGlyphRun::copyConstructor() QGlyphRun glyphs; { - QVector glyphIndexes; - QVector positions; + QList glyphIndexes; + QList positions; QFont font; font.setPointSize(18); @@ -183,7 +183,7 @@ void tst_QGlyphRun::equalsOperator_data() { QGlyphRun busted(two); - QVector positions = busted.positions(); + QList positions = busted.positions(); positions[2] += QPointF(1, 1); busted.setPositions(positions); @@ -204,7 +204,7 @@ void tst_QGlyphRun::equalsOperator_data() { QGlyphRun busted(two); - QVector glyphIndexes = busted.glyphIndexes(); + QList glyphIndexes = busted.glyphIndexes(); glyphIndexes[2] += 1; busted.setGlyphIndexes(glyphIndexes); @@ -228,14 +228,14 @@ void tst_QGlyphRun::isEmpty() QGlyphRun glyphs; QVERIFY(glyphs.isEmpty()); - glyphs.setGlyphIndexes(QVector() << 1 << 2 << 3); + glyphs.setGlyphIndexes(QList() << 1 << 2 << 3); QVERIFY(!glyphs.isEmpty()); glyphs.clear(); QVERIFY(glyphs.isEmpty()); - QVector glyphIndexes = QVector() << 1 << 2 << 3; - QVector positions = QVector() << QPointF(0, 0) << QPointF(0, 0) << QPointF(0, 0); + QList glyphIndexes = QList() << 1 << 2 << 3; + QList positions = QList() << QPointF(0, 0) << QPointF(0, 0) << QPointF(0, 0); glyphs.setRawData(glyphIndexes.constData(), positions.constData(), glyphIndexes.size()); QVERIFY(!glyphs.isEmpty()); } @@ -309,8 +309,8 @@ void tst_QGlyphRun::setRawData() { QGlyphRun glyphRun; glyphRun.setRawFont(QRawFont::fromFont(m_testFont)); - glyphRun.setGlyphIndexes(QVector() << 2 << 2 << 2); - glyphRun.setPositions(QVector() << QPointF(2, 3) << QPointF(20, 3) << QPointF(10, 20)); + glyphRun.setGlyphIndexes(QList() << 2 << 2 << 2); + glyphRun.setPositions(QList() << QPointF(2, 3) << QPointF(20, 3) << QPointF(10, 20)); QPixmap baseline(100, 50); baseline.fill(Qt::white); @@ -357,17 +357,17 @@ void tst_QGlyphRun::setRawData() void tst_QGlyphRun::setRawDataAndGetAsVector() { - QVector glyphIndexArray; + QList glyphIndexArray; glyphIndexArray << 3 << 2 << 1 << 4; - QVector glyphPositionArray; + QList glyphPositionArray; glyphPositionArray << QPointF(1, 2) << QPointF(3, 4) << QPointF(5, 6) << QPointF(7, 8); QGlyphRun glyphRun; glyphRun.setRawData(glyphIndexArray.constData(), glyphPositionArray.constData(), 4); - QVector glyphIndexes = glyphRun.glyphIndexes(); - QVector glyphPositions = glyphRun.positions(); + QList glyphIndexes = glyphRun.glyphIndexes(); + QList glyphPositions = glyphRun.positions(); QCOMPARE(glyphIndexes.size(), 4); QCOMPARE(glyphPositions.size(), 4); @@ -384,10 +384,10 @@ void tst_QGlyphRun::setRawDataAndGetAsVector() void tst_QGlyphRun::drawNonExistentGlyphs() { - QVector glyphIndexes; + QList glyphIndexes; glyphIndexes.append(4); - QVector glyphPositions; + QList glyphPositions; glyphPositions.append(QPointF(0, 0)); QGlyphRun glyphs; @@ -495,17 +495,17 @@ void tst_QGlyphRun::detach() { QGlyphRun glyphs; - glyphs.setGlyphIndexes(QVector() << 1 << 2 << 3); + glyphs.setGlyphIndexes(QList() << 1 << 2 << 3); QGlyphRun otherGlyphs; otherGlyphs = glyphs; QCOMPARE(otherGlyphs.glyphIndexes(), glyphs.glyphIndexes()); - otherGlyphs.setGlyphIndexes(QVector() << 4 << 5 << 6); + otherGlyphs.setGlyphIndexes(QList() << 4 << 5 << 6); - QCOMPARE(otherGlyphs.glyphIndexes(), QVector() << 4 << 5 << 6); - QCOMPARE(glyphs.glyphIndexes(), QVector() << 1 << 2 << 3); + QCOMPARE(otherGlyphs.glyphIndexes(), QList() << 4 << 5 << 6); + QCOMPARE(glyphs.glyphIndexes(), QList() << 1 << 2 << 3); } void tst_QGlyphRun::drawRightToLeft() @@ -559,8 +559,8 @@ void tst_QGlyphRun::boundingRect() QRawFont rawFont(QRawFont::fromFont(QFont())); QVERIFY(rawFont.isValid()); - QVector glyphIndexes = rawFont.glyphIndexesForString(s); - QVector positions = rawFont.advancesForGlyphIndexes(glyphIndexes); + QList glyphIndexes = rawFont.glyphIndexesForString(s); + QList positions = rawFont.advancesForGlyphIndexes(glyphIndexes); QCOMPARE(glyphIndexes.size(), s.size()); QCOMPARE(positions.size(), glyphIndexes.size()); diff --git a/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp b/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp index a32fb1d25b..a443688d7e 100644 --- a/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp +++ b/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp @@ -285,8 +285,8 @@ void tst_QRawFont::glyphIndices() QRawFont font(testFont, 10); QVERIFY(font.isValid()); - QVector glyphIndices = font.glyphIndexesForString(QLatin1String("Foobar")); - QVector expectedGlyphIndices; + QList glyphIndices = font.glyphIndexesForString(QLatin1String("Foobar")); + QList expectedGlyphIndices; expectedGlyphIndices << 44 << 83 << 83 << 70 << 69 << 86; QCOMPARE(glyphIndices, expectedGlyphIndices); @@ -330,11 +330,11 @@ void tst_QRawFont::advances() QRawFontPrivate *font_d = QRawFontPrivate::get(font); QVERIFY(font_d->fontEngine != 0); - QVector glyphIndices; + QList glyphIndices; glyphIndices << 44 << 83 << 83 << 70 << 69 << 86; // "Foobar" bool supportsSubPixelPositions = font_d->fontEngine->supportsSubPixelPositions(); - QVector advances = font.advancesForGlyphIndexes(glyphIndices); + QList advances = font.advancesForGlyphIndexes(glyphIndices); bool mayDiffer = font_d->fontEngine->type() == QFontEngine::Freetype && (hintingPreference == QFont::PreferFullHinting @@ -358,7 +358,7 @@ void tst_QRawFont::advances() QVERIFY(qFuzzyIsNull(advances.at(i).y())); } - advances = font.advancesForGlyphIndexes(QVector()); + advances = font.advancesForGlyphIndexes(QList()); QVERIFY(advances.isEmpty()); int numGlyphs = glyphIndices.size(); @@ -415,7 +415,7 @@ void tst_QRawFont::textLayout() QCOMPARE(rawFont.familyName(), familyName); QCOMPARE(rawFont.pixelSize(), 18.0); - QVector expectedGlyphIndices; + QList expectedGlyphIndices; expectedGlyphIndices << 44 << 83 << 83 << 70 << 69 << 86; QCOMPARE(glyphs.glyphIndexes(), expectedGlyphIndices); @@ -996,10 +996,10 @@ void tst_QRawFont::kernedAdvances() QRawFont font(testFont, pixelSize); QVERIFY(font.isValid()); - QVector glyphIndexes = font.glyphIndexesForString(QStringLiteral("__")); + QList glyphIndexes = font.glyphIndexesForString(QStringLiteral("__")); QCOMPARE(glyphIndexes.size(), 2); - QVector advances = font.advancesForGlyphIndexes(glyphIndexes, QRawFont::KernedAdvances); + QList advances = font.advancesForGlyphIndexes(glyphIndexes, QRawFont::KernedAdvances); QCOMPARE(advances.size(), 2); qreal expectedAdvanceWidth = pixelSize * underScoreAW / emSquareSize; diff --git a/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp b/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp index 55fff34a8e..1301ccc9cf 100644 --- a/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp +++ b/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp @@ -113,8 +113,10 @@ void tst_QSyntaxHighlighter::cleanup() class TestHighlighter : public QSyntaxHighlighter { public: - inline TestHighlighter(const QVector &fmts, QTextDocument *parent) - : QSyntaxHighlighter(parent), formats(fmts), highlighted(false), callCount(0) {} + inline TestHighlighter(const QList &fmts, QTextDocument *parent) + : QSyntaxHighlighter(parent), formats(fmts), highlighted(false), callCount(0) + { + } inline TestHighlighter(QObject *parent) : QSyntaxHighlighter(parent) {} inline TestHighlighter(QTextDocument *parent) @@ -131,7 +133,7 @@ public: ++callCount; } - QVector formats; + QList formats; bool highlighted; int callCount; QString highlightedText; @@ -139,7 +141,7 @@ public: void tst_QSyntaxHighlighter::basic() { - QVector formats; + QList formats; QTextLayout::FormatRange range; range.start = 0; range.length = 2; @@ -206,7 +208,7 @@ void tst_QSyntaxHighlighter::basicTwo() void tst_QSyntaxHighlighter::removeFormatsOnDelete() { - QVector formats; + QList formats; QTextLayout::FormatRange range; range.start = 0; range.length = 9; @@ -403,7 +405,7 @@ void tst_QSyntaxHighlighter::highlightToEndOfDocument2() void tst_QSyntaxHighlighter::preservePreeditArea() { - QVector formats; + QList formats; QTextLayout::FormatRange range; range.start = 0; range.length = 8; @@ -500,7 +502,7 @@ void tst_QSyntaxHighlighter::avoidUnnecessaryDelayedRehighlight() void tst_QSyntaxHighlighter::noContentsChangedDuringHighlight() { - QVector formats; + QList formats; QTextLayout::FormatRange range; range.start = 0; range.length = 10; diff --git a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp index dacb7c14ab..17ce507cdf 100644 --- a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp +++ b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp @@ -1267,7 +1267,7 @@ void tst_QTextDocument::toHtml_data() CREATE_DOC_AND_CURSOR(); QTextTableFormat fmt; - QVector widths; + QList widths; widths.append(QTextLength()); widths.append(QTextLength(QTextLength::PercentageLength, 30)); widths.append(QTextLength(QTextLength::FixedLength, 40)); @@ -1540,7 +1540,7 @@ void tst_QTextDocument::toHtml_data() QTextTable *table = cursor.insertTable(2, 2); table->mergeCells(0, 0, 1, 2); QTextTableFormat fmt = table->format(); - QVector widths; + QList widths; widths.append(QTextLength(QTextLength::FixedLength, 20)); widths.append(QTextLength(QTextLength::FixedLength, 40)); fmt.setColumnWidthConstraints(widths); diff --git a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp index 8a12057527..67bb628215 100644 --- a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp +++ b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp @@ -1175,7 +1175,7 @@ void tst_QTextDocumentFragment::copySubTable() QTextDocumentFragment frag; { QTextTableFormat fmt; - QVector constraints; + QList constraints; constraints << QTextLength(QTextLength::PercentageLength, 16); constraints << QTextLength(QTextLength::PercentageLength, 28); constraints << QTextLength(QTextLength::PercentageLength, 28); @@ -2744,7 +2744,7 @@ void tst_QTextDocumentFragment::html_columnWidths() QCOMPARE(table->rows(), 2); QTextTableFormat fmt = table->format(); - const QVector columnWidths = fmt.columnWidthConstraints(); + const QList columnWidths = fmt.columnWidthConstraints(); QCOMPARE(columnWidths.count(), 2); QCOMPARE(columnWidths.at(0).type(), QTextLength::VariableLength); QCOMPARE(columnWidths.at(1).type(), QTextLength::PercentageLength); diff --git a/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp b/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp index 4e5ef7c555..7548dbb8e4 100644 --- a/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp +++ b/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp @@ -155,7 +155,7 @@ void tst_QTextFormat::testUnderlinePropertyPrecedence() QCOMPARE(format.fontUnderline(), false); QCOMPARE(format.font().underline(), false); - // do it again, but reverse the ordering (we use a QVector internally, so test a LOT ;) + // do it again, but reverse the ordering (we use a QList internally, so test a LOT ;) // create conflict. Should use the new property format.setProperty(QTextCharFormat::FontUnderline, false); format.setProperty(QTextCharFormat::TextUnderlineStyle, QTextCharFormat::SingleUnderline); @@ -210,7 +210,7 @@ void tst_QTextFormat::resolveFont() fmt.setProperty(QTextFormat::FontItalic, true); QTextCursor(&doc).insertText("Test", fmt); - QVector formats = doc.allFormats(); + QList formats = doc.allFormats(); QCOMPARE(formats.count(), 3); QCOMPARE(formats.at(2).type(), int(QTextFormat::CharFormat)); diff --git a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp index cea1dc6dd3..9a55b16af9 100644 --- a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp +++ b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp @@ -117,7 +117,7 @@ static void prepareShapingTest(const QFont &font, const ShapeTable *shape_table) string.append(QChar(*u)); testName.append(" 0x" + QByteArray::number(*u, 16)); } - QVector glyphs; + QList glyphs; for (const ushort *g = s->glyphs; *g; ++g) glyphs.append(*g); @@ -129,7 +129,7 @@ static void doShapingTests() { QFETCH(QFont, font); QFETCH(QString, string); - QFETCH(QVector, glyphs); + QFETCH(QList, glyphs); QVERIFY(!string.isEmpty()); @@ -176,7 +176,7 @@ void tst_QTextScriptEngine::devanagari_data() { QTest::addColumn("font"); QTest::addColumn("string"); - QTest::addColumn >("glyphs"); + QTest::addColumn>("glyphs"); if (!haveTestFonts) QSKIP("Test fonts are not available"); @@ -283,7 +283,7 @@ void tst_QTextScriptEngine::bengali_data() { QTest::addColumn("font"); QTest::addColumn("string"); - QTest::addColumn >("glyphs"); + QTest::addColumn>("glyphs"); if (!haveTestFonts) QSKIP("Test fonts are not available"); @@ -521,7 +521,7 @@ void tst_QTextScriptEngine::gurmukhi_data() { QTest::addColumn("font"); QTest::addColumn("string"); - QTest::addColumn >("glyphs"); + QTest::addColumn>("glyphs"); if (!haveTestFonts) QSKIP("Test fonts are not available"); @@ -549,7 +549,7 @@ void tst_QTextScriptEngine::oriya_data() { QTest::addColumn("font"); QTest::addColumn("string"); - QTest::addColumn >("glyphs"); + QTest::addColumn>("glyphs"); if (!haveTestFonts) QSKIP("Test fonts are not available"); @@ -590,7 +590,7 @@ void tst_QTextScriptEngine::tamil_data() { QTest::addColumn("font"); QTest::addColumn("string"); - QTest::addColumn >("glyphs"); + QTest::addColumn>("glyphs"); if (!haveTestFonts) QSKIP("Test fonts are not available"); @@ -667,7 +667,7 @@ void tst_QTextScriptEngine::telugu_data() { QTest::addColumn("font"); QTest::addColumn("string"); - QTest::addColumn >("glyphs"); + QTest::addColumn>("glyphs"); if (!haveTestFonts) QSKIP("Test fonts are not available"); @@ -716,7 +716,7 @@ void tst_QTextScriptEngine::kannada_data() { QTest::addColumn("font"); QTest::addColumn("string"); - QTest::addColumn >("glyphs"); + QTest::addColumn>("glyphs"); if (!haveTestFonts) QSKIP("Test fonts are not available"); @@ -787,7 +787,7 @@ void tst_QTextScriptEngine::malayalam_data() { QTest::addColumn("font"); QTest::addColumn("string"); - QTest::addColumn >("glyphs"); + QTest::addColumn>("glyphs"); if (!haveTestFonts) QSKIP("Test fonts are not available"); @@ -868,7 +868,7 @@ void tst_QTextScriptEngine::sinhala_data() { QTest::addColumn("font"); QTest::addColumn("string"); - QTest::addColumn >("glyphs"); + QTest::addColumn>("glyphs"); if (!haveTestFonts) QSKIP("Test fonts are not available"); @@ -906,7 +906,7 @@ void tst_QTextScriptEngine::khmer_data() { QTest::addColumn("font"); QTest::addColumn("string"); - QTest::addColumn >("glyphs"); + QTest::addColumn>("glyphs"); if (!haveTestFonts) QSKIP("Test fonts are not available"); @@ -950,7 +950,7 @@ void tst_QTextScriptEngine::linearB_data() { QTest::addColumn("font"); QTest::addColumn("string"); - QTest::addColumn >("glyphs"); + QTest::addColumn>("glyphs"); if (!haveTestFonts) QSKIP("Test fonts are not available"); @@ -978,7 +978,7 @@ void tst_QTextScriptEngine::greek_data() { QTest::addColumn("font"); QTest::addColumn("string"); - QTest::addColumn >("glyphs"); + QTest::addColumn>("glyphs"); if (!haveTestFonts) QSKIP("Test fonts are not available"); @@ -990,7 +990,7 @@ void tst_QTextScriptEngine::greek_data() QString string; string.append(QChar(uc)); QByteArray testName = f.family().toLatin1() + ": 0x" + QByteArray::number(uc, 16); - QTest::newRow(testName.constData()) << f << string << QVector(); + QTest::newRow(testName.constData()) << f << string << QList(); } } else QSKIP("couldn't find DejaVu Sans"); @@ -1003,7 +1003,7 @@ void tst_QTextScriptEngine::greek_data() QString string; string.append(QChar(uc)); QByteArray testName = f.family().toLatin1() + ": 0x" + QByteArray::number(uc, 16); - QTest::newRow(testName.constData()) << f << string << QVector(); + QTest::newRow(testName.constData()) << f << string << QList(); } const ShapeTable shape_table [] = { diff --git a/tests/auto/gui/text/qzip/tst_qzip.cpp b/tests/auto/gui/text/qzip/tst_qzip.cpp index c0bf5fef8e..07672d219d 100644 --- a/tests/auto/gui/text/qzip/tst_qzip.cpp +++ b/tests/auto/gui/text/qzip/tst_qzip.cpp @@ -45,7 +45,7 @@ private slots: void tst_QZip::basicUnpack() { QZipReader zip(QFINDTESTDATA("/testdata/test.zip"), QIODevice::ReadOnly); - QVector files = zip.fileInfoList(); + QList files = zip.fileInfoList(); QCOMPARE(files.count(), 2); QZipReader::FileInfo fi = files.at(0); @@ -81,7 +81,7 @@ void tst_QZip::basicUnpack() void tst_QZip::symlinks() { QZipReader zip(QFINDTESTDATA("/testdata/symlink.zip"), QIODevice::ReadOnly); - QVector files = zip.fileInfoList(); + QList files = zip.fileInfoList(); QCOMPARE(files.count(), 2); QZipReader::FileInfo fi = files.at(0); @@ -104,7 +104,7 @@ void tst_QZip::symlinks() void tst_QZip::readTest() { QZipReader zip("foobar.zip", QIODevice::ReadOnly); // non existing file. - QVector files = zip.fileInfoList(); + QList files = zip.fileInfoList(); QCOMPARE(files.count(), 0); QByteArray b = zip.fileData("foobar"); QCOMPARE(b.size(), 0); @@ -123,7 +123,7 @@ void tst_QZip::createArchive() QBuffer buffer2(&zipFile); QZipReader zip2(&buffer2); - QVector files = zip2.fileInfoList(); + QList files = zip2.fileInfoList(); QCOMPARE(files.count(), 1); QZipReader::FileInfo file = files.at(0); QCOMPARE(file.filePath, QString("My Filename")); diff --git a/tests/auto/gui/util/qshadergenerator/tst_qshadergenerator.cpp b/tests/auto/gui/util/qshadergenerator/tst_qshadergenerator.cpp index 56df69dde8..58bea1b6b7 100644 --- a/tests/auto/gui/util/qshadergenerator/tst_qshadergenerator.cpp +++ b/tests/auto/gui/util/qshadergenerator/tst_qshadergenerator.cpp @@ -53,7 +53,8 @@ namespace return port; } - QShaderNode createNode(const QVector &ports, const QStringList &layers = QStringList()) + QShaderNode createNode(const QList &ports, + const QStringList &layers = QStringList()) { auto node = QShaderNode(); node.setUuid(QUuid::createUuid()); diff --git a/tests/auto/gui/util/qshadergraph/tst_qshadergraph.cpp b/tests/auto/gui/util/qshadergraph/tst_qshadergraph.cpp index 014a163f58..3a8d5700b4 100644 --- a/tests/auto/gui/util/qshadergraph/tst_qshadergraph.cpp +++ b/tests/auto/gui/util/qshadergraph/tst_qshadergraph.cpp @@ -41,7 +41,8 @@ namespace return port; } - QShaderNode createNode(const QVector &ports, const QStringList &layers = QStringList()) + QShaderNode createNode(const QList &ports, + const QStringList &layers = QStringList()) { auto node = QShaderNode(); node.setUuid(QUuid::createUuid()); @@ -65,8 +66,8 @@ namespace } QShaderGraph::Statement createStatement(const QShaderNode &node, - const QVector &inputs = QVector(), - const QVector &outputs = QVector()) + const QList &inputs = QList(), + const QList &outputs = QList()) { auto statement = QShaderGraph::Statement(); statement.node = node; @@ -80,7 +81,8 @@ namespace qDebug() << prefix << statement.inputs << statement.uuid().toString() << statement.outputs; } - void dumpStatementsIfNeeded(const QVector &statements, const QVector &expected) + void dumpStatementsIfNeeded(const QList &statements, + const QList &expected) { if (statements != expected) { for (int i = 0; i < qMax(statements.size(), expected.size()); i++) { @@ -464,14 +466,12 @@ void tst_QShaderGraph::shouldSerializeGraphForCodeGeneration() const auto statements = graph.createStatements(); // THEN - const auto expected = QVector() - << createStatement(input2, {}, {1}) - << createStatement(input1, {}, {0}) - << createStatement(function2, {0, 1}, {3}) - << createStatement(function1, {0}, {2}) - << createStatement(function3, {2, 3}, {4, 5}) - << createStatement(output2, {5}, {}) - << createStatement(output1, {4}, {}); + const auto expected = QList() + << createStatement(input2, {}, { 1 }) << createStatement(input1, {}, { 0 }) + << createStatement(function2, { 0, 1 }, { 3 }) + << createStatement(function1, { 0 }, { 2 }) + << createStatement(function3, { 2, 3 }, { 4, 5 }) << createStatement(output2, { 5 }, {}) + << createStatement(output1, { 4 }, {}); dumpStatementsIfNeeded(statements, expected); QCOMPARE(statements, expected); } @@ -517,8 +517,7 @@ void tst_QShaderGraph::shouldHandleUnboundPortsDuringGraphSerialization() // THEN // Note that no statement has any unbound input - const auto expected = QVector() - << createStatement(input, {}, {0}); + const auto expected = QList() << createStatement(input, {}, { 0 }); dumpStatementsIfNeeded(statements, expected); QCOMPARE(statements, expected); } @@ -566,7 +565,7 @@ void tst_QShaderGraph::shouldSurviveCyclesDuringGraphSerialization() // THEN // The cycle is ignored - const auto expected = QVector(); + const auto expected = QList(); dumpStatementsIfNeeded(statements, expected); QCOMPARE(statements, expected); } @@ -641,16 +640,14 @@ void tst_QShaderGraph::shouldDealWithEdgesJumpingOverLayers() const auto statements = graph.createStatements(); // THEN - const auto expected = QVector() - << createStatement(texCoord, {}, {2}) - << createStatement(texture, {}, {1}) - << createStatement(lightIntensity, {}, {3}) - << createStatement(sampleTexture, {1, 2}, {5}) - << createStatement(worldPosition, {}, {0}) - << createStatement(exposure, {}, {4}) - << createStatement(lightFunction, {5, 0, 3}, {6}) - << createStatement(exposureFunction, {6, 4}, {7}) - << createStatement(fragColor, {7}, {}); + const auto expected = QList() + << createStatement(texCoord, {}, { 2 }) << createStatement(texture, {}, { 1 }) + << createStatement(lightIntensity, {}, { 3 }) + << createStatement(sampleTexture, { 1, 2 }, { 5 }) + << createStatement(worldPosition, {}, { 0 }) << createStatement(exposure, {}, { 4 }) + << createStatement(lightFunction, { 5, 0, 3 }, { 6 }) + << createStatement(exposureFunction, { 6, 4 }, { 7 }) + << createStatement(fragColor, { 7 }, {}); dumpStatementsIfNeeded(statements, expected); QCOMPARE(statements, expected); } @@ -716,11 +713,11 @@ void tst_QShaderGraph::shouldGenerateDifferentStatementsDependingOnActiveLayers( const auto statements = graph.createStatements({"diffuseUniform", "normalUniform"}); // THEN - const auto expected = QVector() - << createStatement(normalUniform, {}, {1}) - << createStatement(diffuseUniform, {}, {0}) - << createStatement(lightFunction, {0, 1}, {2}) - << createStatement(fragColor, {2}, {}); + const auto expected = QList() + << createStatement(normalUniform, {}, { 1 }) + << createStatement(diffuseUniform, {}, { 0 }) + << createStatement(lightFunction, { 0, 1 }, { 2 }) + << createStatement(fragColor, { 2 }, {}); dumpStatementsIfNeeded(statements, expected); QCOMPARE(statements, expected); } @@ -730,12 +727,12 @@ void tst_QShaderGraph::shouldGenerateDifferentStatementsDependingOnActiveLayers( const auto statements = graph.createStatements({"diffuseUniform", "normalTexture"}); // THEN - const auto expected = QVector() - << createStatement(texCoord, {}, {0}) - << createStatement(normalTexture, {0}, {2}) - << createStatement(diffuseUniform, {}, {1}) - << createStatement(lightFunction, {1, 2}, {3}) - << createStatement(fragColor, {3}, {}); + const auto expected = QList() + << createStatement(texCoord, {}, { 0 }) + << createStatement(normalTexture, { 0 }, { 2 }) + << createStatement(diffuseUniform, {}, { 1 }) + << createStatement(lightFunction, { 1, 2 }, { 3 }) + << createStatement(fragColor, { 3 }, {}); dumpStatementsIfNeeded(statements, expected); QCOMPARE(statements, expected); } @@ -745,12 +742,11 @@ void tst_QShaderGraph::shouldGenerateDifferentStatementsDependingOnActiveLayers( const auto statements = graph.createStatements({"diffuseTexture", "normalUniform"}); // THEN - const auto expected = QVector() - << createStatement(texCoord, {}, {0}) - << createStatement(normalUniform, {}, {2}) - << createStatement(diffuseTexture, {0}, {1}) - << createStatement(lightFunction, {1, 2}, {3}) - << createStatement(fragColor, {3}, {}); + const auto expected = QList() + << createStatement(texCoord, {}, { 0 }) << createStatement(normalUniform, {}, { 2 }) + << createStatement(diffuseTexture, { 0 }, { 1 }) + << createStatement(lightFunction, { 1, 2 }, { 3 }) + << createStatement(fragColor, { 3 }, {}); dumpStatementsIfNeeded(statements, expected); QCOMPARE(statements, expected); } @@ -760,12 +756,12 @@ void tst_QShaderGraph::shouldGenerateDifferentStatementsDependingOnActiveLayers( const auto statements = graph.createStatements({"diffuseTexture", "normalTexture"}); // THEN - const auto expected = QVector() - << createStatement(texCoord, {}, {0}) - << createStatement(normalTexture, {0}, {2}) - << createStatement(diffuseTexture, {0}, {1}) - << createStatement(lightFunction, {1, 2}, {3}) - << createStatement(fragColor, {3}, {}); + const auto expected = QList() + << createStatement(texCoord, {}, { 0 }) + << createStatement(normalTexture, { 0 }, { 2 }) + << createStatement(diffuseTexture, { 0 }, { 1 }) + << createStatement(lightFunction, { 1, 2 }, { 3 }) + << createStatement(fragColor, { 3 }, {}); dumpStatementsIfNeeded(statements, expected); QCOMPARE(statements, expected); } @@ -806,11 +802,10 @@ void tst_QShaderGraph::shouldDealWithBranchesWithoutOutput() // THEN // Note that no edge leads to the unbound input - const auto expected = QVector() - << createStatement(input, {}, {0}) - << createStatement(function, {0}, {1}) - << createStatement(output, {1}, {}) - << createStatement(danglingFunction, {0}, {2}); + const auto expected = QList() + << createStatement(input, {}, { 0 }) << createStatement(function, { 0 }, { 1 }) + << createStatement(output, { 1 }, {}) + << createStatement(danglingFunction, { 0 }, { 2 }); dumpStatementsIfNeeded(statements, expected); QCOMPARE(statements, expected); } diff --git a/tests/auto/gui/util/qshadergraphloader/tst_qshadergraphloader.cpp b/tests/auto/gui/util/qshadergraphloader/tst_qshadergraphloader.cpp index 761e03a195..89cd5a7ecb 100644 --- a/tests/auto/gui/util/qshadergraphloader/tst_qshadergraphloader.cpp +++ b/tests/auto/gui/util/qshadergraphloader/tst_qshadergraphloader.cpp @@ -67,7 +67,8 @@ namespace return port; } - QShaderNode createNode(const QVector &ports, const QStringList &layers = QStringList()) + QShaderNode createNode(const QList &ports, + const QStringList &layers = QStringList()) { auto node = QShaderNode(); node.setUuid(QUuid::createUuid()); @@ -216,7 +217,8 @@ namespace qDebug() << prefix << statement.inputs << statement.uuid().toString() << statement.outputs; } - void dumpStatementsIfNeeded(const QVector &statements, const QVector &expected) + void dumpStatementsIfNeeded(const QList &statements, + const QList &expected) { if (statements != expected) { for (int i = 0; i < qMax(statements.size(), expected.size()); i++) { diff --git a/tests/auto/gui/util/qshadernodesloader/tst_qshadernodesloader.cpp b/tests/auto/gui/util/qshadernodesloader/tst_qshadernodesloader.cpp index ec1bd87a32..f3e1013a4b 100644 --- a/tests/auto/gui/util/qshadernodesloader/tst_qshadernodesloader.cpp +++ b/tests/auto/gui/util/qshadernodesloader/tst_qshadernodesloader.cpp @@ -71,7 +71,7 @@ namespace return port; } - QShaderNode createNode(const QVector &ports) + QShaderNode createNode(const QList &ports) { auto node = QShaderNode(); for (const auto &port : ports) -- cgit v1.2.3