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 <marc.mutz@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
bb10
Edward Welbourne 2022-10-07 18:58:47 +02:00
parent 119801f70d
commit 4af55438d0
1 changed files with 8 additions and 8 deletions

View File

@ -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;
}
}