From e937243e4f047df9ba488f33dcb6eeff338c1d22 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Wed, 9 Apr 2025 17:01:14 +0200 Subject: [PATCH] tst_qgraphicslinearlayout: avoid duplicate data tags in removeAt() Avoid the duplicated data tags in removeAt() tests by adding the orientation to the tag. Pick-to: 6.5 Fixes: QTBUG-135294 Change-Id: If31d719e4a9b1c90e591cedc149848bbb9c99657 Reviewed-by: Volker Hilsheimer (cherry picked from commit 0b668c2f55f0fc797a2366b3dc73395f79e1b585) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit 62c1f8da1e4652d6dd2ac18f658397a6af7d06d4) --- .../tst_qgraphicslinearlayout.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp index 3a511af4598..642915424a2 100644 --- a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp @@ -714,12 +714,12 @@ void tst_QGraphicsLinearLayout::removeAt_data() QTest::addColumn("orientation"); for (int i = -1; i < 4; ++i) { const QByteArray iB = QByteArray::number(i); - for (int k = 0; k < 2; ++k) { - Qt::Orientation orientation = (k == 0) ? Qt::Vertical : Qt::Horizontal; - QTest::newRow(("0, 0, " + iB).constData()) << 0 << 0 << i << orientation; - QTest::newRow(("1, 0, " + iB).constData()) << 1 << 0 << i << orientation; - QTest::newRow(("0, 1, " + iB).constData()) << 0 << 1 << i << orientation; - QTest::newRow(("2, 2, " + iB).constData()) << 2 << 2 << i << orientation; + for (Qt::Orientation orientation : {Qt::Vertical, Qt::Horizontal}) { + const QByteArray orientStr = orientation == Qt::Vertical ? ", vertical" : ", horizontal"; + QTest::newRow(("0, 0, " + iB + orientStr).constData()) << 0 << 0 << i << orientation; + QTest::newRow(("1, 0, " + iB + orientStr).constData()) << 1 << 0 << i << orientation; + QTest::newRow(("0, 1, " + iB + orientStr).constData()) << 0 << 1 << i << orientation; + QTest::newRow(("2, 2, " + iB + orientStr).constData()) << 2 << 2 << i << orientation; } } }