From 4af55438d05221edbda01d4c173c0ab3da88f850 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 7 Oct 2022 18:58:47 +0200 Subject: [PATCH] tst_QPainterPath::testArcMoveTo(): include index in some data tags In the process, clean up the building of the data tags: use a range-for loop, albeit we do need an index to show in tags; show it and the angle in the tags using addRow()'s easier formatting. Change the low angle tests to show the sign of the angle (which is how they differ)rather than just labeling them 1 and 2. Change-Id: Ib5aaa3e22d771c530c9343ba368b0fdfceb264ce Reviewed-by: Marc Mutz Reviewed-by: Jason McDonald --- .../painting/qpainterpath/tst_qpainterpath.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp index 8bf538175b..9938230551 100644 --- a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp +++ b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp @@ -893,17 +893,17 @@ void tst_QPainterPath::testArcMoveTo_data() QRectF(100, 100, 100, -100), QRectF(100, 100, -100, -100), }; + constexpr qreal tinyAngle = 1e-10; - for (uint domain = 0; domain < sizeof rects / sizeof *rects; ++domain) { - const QByteArray dB = QByteArray::number(domain); - for (int i=-360; i<=360; ++i) { - QTest::newRow(("test " + dB + ' ' + QByteArray::number(i)).constData()) - << rects[domain] << (qreal) i; - } + int index = 0; + for (const auto &rect : rects) { + for (int i = -360; i <= 360; ++i) + QTest::addRow("test %d %d", index, i) << rect << qreal(i); // test low angles - QTest::newRow("low angles 1") << rects[domain] << (qreal) 1e-10; - QTest::newRow("low angles 2") << rects[domain] << (qreal)-1e-10; + QTest::addRow("low +angle %d", index) << rect << tinyAngle; + QTest::addRow("low -angle %d", index) << rect << -tinyAngle; + ++index; } }