Remove Q_ASSERT from qtesselator autotest
If the test data is incorrect, print a meaningful warning into the test output instead of deferencing an iterator beyond the last element in the list. Change-Id: I7be4f282639453de6d8240a2f17253025b415337 Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern (cherry picked from commit f01e2a5024db69913aed016e2854b2589ca85080)
This commit is contained in:
parent
d7e10b2a71
commit
c0372871f8
@ -98,8 +98,12 @@ static QList<QPointF> parsePoints(const QByteArray &line)
|
||||
QList<qreal> nums = parseNumbersList(it);
|
||||
QList<qreal>::const_iterator nitr;
|
||||
for (nitr = nums.begin(); nitr != nums.end(); ++nitr) {
|
||||
qreal x = *nitr; ++nitr;
|
||||
Q_ASSERT(nitr != nums.end());
|
||||
qreal x = *nitr;
|
||||
++nitr;
|
||||
if (nitr == nums.end()) {
|
||||
qWarning() << "parsePoints: Even number of co-ordinates required, odd number found: skipping last point";
|
||||
break;
|
||||
}
|
||||
qreal y = *nitr;
|
||||
res.append(QPointF(x, y));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user