From: Bradley T. Hughes Date: Fri, 13 Jan 2012 10:11:57 +0000 (+0100) Subject: Make tst_QGraphicsAnchorLayout1 pass on Mac OS X X-Git-Tag: qt-v5.0.0-alpha1~1769 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=147bbda0675b7cc7afaea6bc617d6a0f249978f0;p=profile%2Fivi%2Fqtbase.git Make tst_QGraphicsAnchorLayout1 pass on Mac OS X On Mac OS X, tests are build with QT_DEBUG defined, but run against libraries built with QT_NO_DEBUG, so the expected warning output is not seen. Use a run-time check instead to know whether or not to expect the warning output. Change-Id: Ifb772b764d4135cc8f896827727939fd8cff5388 Reviewed-by: Jason McDonald --- diff --git a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp index 0fd19c4..57be32d 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp @@ -559,10 +559,9 @@ void tst_QGraphicsAnchorLayout1::testSpecialCases() { // One widget, setLayout before defining layouts { -#ifdef QT_DEBUG - QTest::ignoreMessage(QtWarningMsg, "QGraphicsLayout::addChildLayoutItem: QGraphicsWidget \"\"" - " in wrong parent; moved to correct parent"); -#endif + if (QLibraryInfo::isDebugBuild()) + QTest::ignoreMessage(QtWarningMsg, "QGraphicsLayout::addChildLayoutItem: QGraphicsWidget \"\"" + " in wrong parent; moved to correct parent"); QGraphicsWidget *widget = new QGraphicsWidget; TheAnchorLayout *layout = new TheAnchorLayout(); widget->setLayout(layout); @@ -581,10 +580,9 @@ void tst_QGraphicsAnchorLayout1::testSpecialCases() // One widget, layout inside layout, layout inside layout inside layout { -#ifdef QT_DEBUG - QTest::ignoreMessage(QtWarningMsg, "QGraphicsLayout::addChildLayoutItem: QGraphicsWidget \"\"" - " in wrong parent; moved to correct parent"); -#endif + if (QLibraryInfo::isDebugBuild()) + QTest::ignoreMessage(QtWarningMsg, "QGraphicsLayout::addChildLayoutItem: QGraphicsWidget \"\"" + " in wrong parent; moved to correct parent"); QGraphicsWidget *widget = new QGraphicsWidget; TheAnchorLayout *layout = new TheAnchorLayout(); widget->setLayout(layout);