From fcf12e50c9d68ba3adcb23d778a4c6d1ffbd73b9 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 27 Mar 2025 21:06:49 +0100 Subject: [PATCH] tst_QGraphicsLinearLayout: remove dead code (dump()) This test function hasn't tested anything since the start of the public history, and leaks memory (the QGraphicsWidgets). The dump() function, while implemented, doesn't do anything by default (#ifdef'ed out), so there's no point in adding actual dump() calls here, either. Remove this function as dead code. Amends the start of the public history. Pick-to: 6.8 6.5 5.15 Change-Id: I6d9d224945fab0f97db0c5ea7d13a7df6c8837b2 Reviewed-by: Axel Spoerl (cherry picked from commit 891473270869a29a6efb09962cf4cb19cc4d8d9e) Reviewed-by: Qt Cherry-pick Bot --- .../tst_qgraphicslinearlayout.cpp | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp index 2d9a7f0625f..f7137b1e12a 100644 --- a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp @@ -26,8 +26,6 @@ private slots: void alignment(); void count_data(); void count(); - void dump_data(); - void dump(); void geometry_data(); void geometry(); void insertItem_data(); @@ -373,31 +371,6 @@ void tst_QGraphicsLinearLayout::count() // see also removeAt() } -void tst_QGraphicsLinearLayout::dump_data() -{ - QTest::addColumn("itemCount"); - QTest::addColumn("layoutCount"); - for (int i = -1; i < 3; ++i) { - const QByteArray iB = QByteArray::number(i); - QTest::newRow((iB + ", 0, 0").constData()) << 0 << 0; - QTest::newRow((iB + ", 0, 5").constData()) << 5 << 5; - QTest::newRow((iB + ", 5, 0").constData()) << 5 << 5; - QTest::newRow((iB + ", 5, 5").constData()) << 5 << 5; - } -} - -// void dump(int indent = 0) const public -void tst_QGraphicsLinearLayout::dump() -{ - QFETCH(int, itemCount); - QFETCH(int, layoutCount); - SubQGraphicsLinearLayout layout; - for (int i = 0; i < itemCount; ++i) - layout.addItem(new QGraphicsWidget); - for (int i = 0; i < layoutCount; ++i) - layout.addItem(new SubQGraphicsLinearLayout); -} - void tst_QGraphicsLinearLayout::geometry_data() { QTest::addColumn("itemCount");