diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-08-05 10:04:11 +0300 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-08-05 19:33:05 +0000 |
commit | 96317570efd959b9bcc0092ad65a3b228a75f5f1 (patch) | |
tree | b807b6effaadf97a051d653354995ccf6932f7d5 /tests | |
parent | 009f1f28120c473632d4a91d6a79c056ac2bbe6a (diff) |
tst_QPainterPath: clean up
- port uses of dynamic containers with static content to constexpr
C arrays
Fixes errors pointed out by my tree's static checks.
Change-Id: I5e1cafa6e428500afae0d653ce48a7fb465c19ed
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp index 0261f60479..98f63984b3 100644 --- a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp +++ b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp @@ -840,22 +840,23 @@ void tst_QPainterPath::testArcMoveTo_data() QTest::addColumn<QRectF>("rect"); QTest::addColumn<qreal>("angle"); - QList<QRectF> rects; - rects << QRectF(100, 100, 100, 100) - << QRectF(100, 100, -100, 100) - << QRectF(100, 100, 100, -100) - << QRectF(100, 100, -100, -100); - - for (int domain=0; domain<rects.size(); ++domain) { + static Q_CONSTEXPR QRectF rects[] = { + QRectF(100, 100, 100, 100), + QRectF(100, 100, -100, 100), + QRectF(100, 100, 100, -100), + QRectF(100, 100, -100, -100), + }; + + 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.at(domain) << (qreal) i; + << rects[domain] << (qreal) i; } // test low angles - QTest::newRow("low angles 1") << rects.at(domain) << (qreal) 1e-10; - QTest::newRow("low angles 2") << rects.at(domain) << (qreal)-1e-10; + QTest::newRow("low angles 1") << rects[domain] << (qreal) 1e-10; + QTest::newRow("low angles 2") << rects[domain] << (qreal)-1e-10; } } |