tst_QSctpSocket: replace QList with const array
"Never use a dynamically-sized container for statically-sized data." Port the loop from Q_FOREACH (which can't deal with arrays) to ranged for (which can). Task-number: QTBUG-115839 Change-Id: Iecfc037c8bbfc0b3196ed0c65f680768a8d2353a Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> (cherry picked from commit 3b6ae86ce8a1d45e735c748f1cc766d9c592755a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
5bae58bb45
commit
c9d8bcb9dd
@ -127,12 +127,13 @@ void tst_QSctpSocket::bind_data()
|
|||||||
// these ranges are guaranteed to be reserved for 'documentation purposes',
|
// these ranges are guaranteed to be reserved for 'documentation purposes',
|
||||||
// and thus, should be unused in the real world. Not that I'm assuming the
|
// and thus, should be unused in the real world. Not that I'm assuming the
|
||||||
// world is full of competent administrators, or anything.
|
// world is full of competent administrators, or anything.
|
||||||
QStringList knownBad;
|
const QString knownBad[] = {
|
||||||
knownBad << "198.51.100.1";
|
"198.51.100.1",
|
||||||
knownBad << "2001:0DB8::1";
|
"2001:0DB8::1",
|
||||||
foreach (const QString &badAddress, knownBad) {
|
};
|
||||||
|
|
||||||
|
for (const QString &badAddress : knownBad)
|
||||||
QTest::newRow(badAddress.toLatin1().constData()) << badAddress << false << QString();
|
QTest::newRow(badAddress.toLatin1().constData()) << badAddress << false << QString();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Testing bind function
|
// Testing bind function
|
||||||
|
Loading…
x
Reference in New Issue
Block a user