Fix failing tst_QQuickPathView::undefinedPath()
authorBea Lam <bea.lam@nokia.com>
Mon, 9 Jan 2012 02:55:52 +0000 (12:55 +1000)
committerQt by Nokia <qt-info@nokia.com>
Mon, 9 Jan 2012 03:05:17 +0000 (04:05 +0100)
Test was failing on Mac because QPainterPath only prints the relevant
warnings if QT_NO_DEBUG is not defined, which is not the case for
standard builds on Mac.

Task-number: QTBUG-23482
Change-Id: Ied4d263a1ce7503b573ecc3c53787dac2b57cc74
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
tests/auto/qtquick2/qquickpathview/tst_qquickpathview.cpp

index 8e602c7..2d6293c 100644 (file)
@@ -1288,17 +1288,16 @@ void tst_QQuickPathView::visualDataModel()
 
 void tst_QQuickPathView::undefinedPath()
 {
-#ifdef Q_OS_MAC
-    QSKIP("QTBUG-23482");
-#endif
-
     QDeclarativeEngine engine;
 
-    QString warning1("QPainterPath::moveTo: Adding point where x or y is NaN or Inf, ignoring call");
-    QTest::ignoreMessage(QtWarningMsg,qPrintable(warning1));
+    // QPainterPath warnings are only received if QT_NO_DEBUG is not defined
+    if (QLibraryInfo::isDebugBuild()) {
+        QString warning1("QPainterPath::moveTo: Adding point where x or y is NaN or Inf, ignoring call");
+        QTest::ignoreMessage(QtWarningMsg,qPrintable(warning1));
 
-    QString warning2("QPainterPath::lineTo: Adding point where x or y is NaN or Inf, ignoring call");
-    QTest::ignoreMessage(QtWarningMsg,qPrintable(warning2));
+        QString warning2("QPainterPath::lineTo: Adding point where x or y is NaN or Inf, ignoring call");
+        QTest::ignoreMessage(QtWarningMsg,qPrintable(warning2));
+    }
 
     QDeclarativeComponent c(&engine, testFileUrl("undefinedpath.qml"));