summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2017-01-05 15:43:21 +0100
committerMarc Mutz <marc.mutz@kdab.com>2017-01-10 07:47:26 +0000
commitb2173b54ef9ede85d88cb0fdf025b26e732ed44a (patch)
tree924daecbd0281944634838e2b19c6296c8fffd3d /tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp
parentd135acfa43810b2f7a2dba12688bbaa07a2e08cc (diff)
Long live QTest::addRow()!
This new function does the same as newRow(), except that it has a less confusing name (in line with _add_Column()), and accepts printf-style arguments to avoid the need to newRow(qPrintable(QString::asprintf())), a common pattern in client code. It uses qvsnprintf() under the hoods, avoiding the need for the QString const char* round-trip. Port all in-tree users of newRow(qPrintable(QString::asnprintf())) to the new function. Change-Id: Icd5de9b7ea4f6759d98080ec30f5aecadb8bec39 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp')
-rw-r--r--tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp b/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp
index 06e2e1cc45..a68671d899 100644
--- a/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp
+++ b/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp
@@ -176,9 +176,9 @@ void tst_QLatin1String::relationalOperators_data()
for (Data *lhs = data; lhs != data + sizeof data / sizeof *data; ++lhs) {
for (Data *rhs = data; rhs != data + sizeof data / sizeof *data; ++rhs) {
QLatin1StringContainer l = { lhs->l1 }, r = { rhs->l1 };
- QTest::newRow(qPrintable(QString::asprintf("\"%s\" <> \"%s\"",
- lhs->l1.data() ? lhs->l1.data() : "nullptr",
- rhs->l1.data() ? rhs->l1.data() : "nullptr")))
+ QTest::addRow("\"%s\" <> \"%s\"",
+ lhs->l1.data() ? lhs->l1.data() : "nullptr",
+ rhs->l1.data() ? rhs->l1.data() : "nullptr")
<< l << lhs->order << r << rhs->order;
}
}