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 <jason.mcdonald@nokia.com>
This commit is contained in:
Bradley T. Hughes 2012-01-13 11:11:57 +01:00 committed by Qt by Nokia
parent 42744812dc
commit 147bbda067

View File

@ -559,10 +559,9 @@ void tst_QGraphicsAnchorLayout1::testSpecialCases()
{
// One widget, setLayout before defining layouts
{
#ifdef QT_DEBUG
if (QLibraryInfo::isDebugBuild())
QTest::ignoreMessage(QtWarningMsg, "QGraphicsLayout::addChildLayoutItem: QGraphicsWidget \"\""
" in wrong parent; moved to correct parent");
#endif
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
if (QLibraryInfo::isDebugBuild())
QTest::ignoreMessage(QtWarningMsg, "QGraphicsLayout::addChildLayoutItem: QGraphicsWidget \"\""
" in wrong parent; moved to correct parent");
#endif
QGraphicsWidget *widget = new QGraphicsWidget;
TheAnchorLayout *layout = new TheAnchorLayout();
widget->setLayout(layout);