summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2017-01-14 10:16:00 +0100
committerMarc Mutz <marc.mutz@kdab.com>2017-04-24 19:22:53 +0000
commitff93eddfd5dc4bae0a037dfa6be27e8f6014f6ec (patch)
treeaa7ce40183289e854281941ebf770c0b2004bb91 /tests/auto/gui/painting/qpainter/tst_qpainter.cpp
parent47fdb2c8e36d5c5cd83b7f87a4cdf3d5e9eeea93 (diff)
tests/auto/gui: use new QTest::addRow() more
... for calculated test data names. In tst_qimage.cpp, use QLatin1String instead of QString for image format pretty-printing, to avoid needless memory allocation and, more importantly in the context of this patch, to make the result usable with addRow(), which does not support %ls. Change-Id: Ib1953aee2da235ae912917a450491ac8be69ca3a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto/gui/painting/qpainter/tst_qpainter.cpp')
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
index 7f72fb04f2..b7fe25059f 100644
--- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
@@ -3508,11 +3508,9 @@ void tst_QPainter::drawImage_data()
continue;
for (int odd_x = 0; odd_x <= 1; ++odd_x) {
for (int odd_width = 0; odd_width <= 1; ++odd_width) {
- QString description =
- QString("srcFormat %1, dstFormat %2, odd x: %3, odd width: %4")
- .arg(srcFormat).arg(dstFormat).arg(odd_x).arg(odd_width);
-
- QTest::newRow(qPrintable(description)) << (10 + odd_x) << 10 << (20 + odd_width) << 20
+ QTest::addRow("srcFormat %d, dstFormat %d, odd x: %d, odd width: %d",
+ srcFormat, dstFormat, odd_x, odd_width)
+ << (10 + odd_x) << 10 << (20 + odd_width) << 20
<< QImage::Format(srcFormat)
<< QImage::Format(dstFormat);
}