[QtCore] QDateTime: switch from newRow to addRow in unit tests

Instead of doing string formating first and then using QTest::newRow,
we can do both at the same time using QTest::addRow

Change-Id: Ia5c90eb705a806e37b96a1fa174a6557f91bee6d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
This commit is contained in:
Andreas Buhr 2020-09-09 20:04:59 +02:00
parent 1ab2d8f5eb
commit 3a1dad83ed

View File

@ -2018,13 +2018,13 @@ void tst_QDateTime::operator_insert_extract_data()
const QDataStream::Version dataStreamVersion = static_cast<QDataStream::Version>(version);
const QByteArray vN = QByteArray::number(dataStreamVersion);
const QByteArray pY = positiveYear.toString().toLatin1();
QTest::newRow(('v' + vN + " WA => HAWAII " + pY).constData())
QTest::addRow("v%d WA => HAWAII %d", version, 2012)
<< positiveYear << westernAustralia << hawaii << dataStreamVersion;
QTest::newRow(('v' + vN + " WA => WA " + pY).constData())
QTest::addRow("v%d WA => WA %d", version, 2012)
<< positiveYear << westernAustralia << westernAustralia << dataStreamVersion;
QTest::newRow(('v' + vN + " HAWAII => WA " + negativeYear.toString().toLatin1()).constData())
QTest::addRow("v%d HAWAII => WA %d", version, -2012)
<< negativeYear << hawaii << westernAustralia << dataStreamVersion;
QTest::newRow(('v' + vN + " HAWAII => HAWAII " + pY).constData())
QTest::addRow("v%d HAWAII => HAWAII %d", version, 2012)
<< positiveYear << hawaii << hawaii << dataStreamVersion;
}
}