diff --git a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp index 9938230551..20ee6e07c7 100644 --- a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp +++ b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp @@ -1220,38 +1220,65 @@ void tst_QPainterPath::testNaNandInfinites() QPointF p3 = QPointF(qQNaN(), 1); QPointF pInf = QPointF(qInf(), 1); - // all these operations with NaN/Inf should be ignored - // can't test operator>> reliably, as we can't create a path with NaN to << later + // All these operations with NaN/Inf should be ignored. + // Can't test operator>> reliably, as we can't create a path with NaN to << later. +#ifdef QT_NO_DEBUG +# define WARNS(name) +#else +# define WARNS(name) \ + QTest::ignoreMessage(QtWarningMsg, "QPainterPath::" #name ": " \ + "Adding point with invalid coordinates, ignoring call") +#endif + WARNS(moveTo); path1.moveTo(p1); + WARNS(moveTo); path1.moveTo(qSNaN(), qQNaN()); + WARNS(moveTo); path1.moveTo(pInf); + WARNS(lineTo); path1.lineTo(p1); + WARNS(lineTo); path1.lineTo(qSNaN(), qQNaN()); + WARNS(lineTo); path1.lineTo(pInf); + WARNS(cubicTo); path1.cubicTo(p1, p2, p3); + WARNS(cubicTo); path1.cubicTo(p1, QPointF(1, 1), QPointF(2, 2)); + WARNS(cubicTo); path1.cubicTo(pInf, QPointF(10, 10), QPointF(5, 1)); + WARNS(quadTo); path1.quadTo(p1, p2); + WARNS(quadTo); path1.quadTo(QPointF(1, 1), p3); + WARNS(quadTo); path1.quadTo(QPointF(1, 1), pInf); + WARNS(arcTo); path1.arcTo(QRectF(p1, p2), 5, 5); + WARNS(arcTo); path1.arcTo(QRectF(pInf, QPointF(1, 1)), 5, 5); + WARNS(addRect); path1.addRect(QRectF(p1, p2)); + WARNS(addRect); path1.addRect(QRectF(pInf, QPointF(1, 1))); + WARNS(addEllipse); path1.addEllipse(QRectF(p1, p2)); + WARNS(addEllipse); path1.addEllipse(QRectF(pInf, QPointF(1, 1))); +#undef WARNS + QCOMPARE(path1, path2); path1.lineTo(QPointF(1, 1)); - QVERIFY(path1 != path2); + QCOMPARE_NE(path1, path2); } #endif // signaling_nan