summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2012-02-07 14:09:10 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-07 08:29:19 +0100
commit9221757cde0bbfa2f45c43c8686a8b954027fdbf (patch)
tree5598a945c00424de965418836ead534e8df557d2 /tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
parentcfd8a9a4486cf5ca4bf8e0a87459ad5d2c3ca3dd (diff)
Fix error in qgraphicsanchorlayout1 autotest.
QTest::ignoreMessage() cannot be called when creating test data rows, but rather must be called when executing a row. Change-Id: Ic958c4e5c15dd53a48479099b6b07803af6cb789 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp')
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp44
1 files changed, 25 insertions, 19 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
index 3a8e109d80..97feb642dc 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
@@ -1835,15 +1835,6 @@ void tst_QGraphicsAnchorLayout1::testCenterAnchors_data()
theResult
<< BasicResult(0, QRectF(5, 5, 10, 10) );
- QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor edges of different orientations");
- QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor edges of different orientations");
- QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor edges of different orientations");
- QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
- QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
- QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
- QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
- QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
- QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
QTest::newRow("center, basic with invalid") << QSizeF(20, 20) << theData << theResult;
}
@@ -1975,9 +1966,6 @@ void tst_QGraphicsAnchorLayout1::testCenterAnchors_data()
<< BasicResult(1, QRectF(20, 0, 30, 10))
<< BasicResult(2, QRectF(60, 15, 40, 10));
- QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
- QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
-
QTest::newRow("center, three") << QSizeF(100, 50) << theData << theResult;
}
@@ -2062,6 +2050,21 @@ void tst_QGraphicsAnchorLayout1::testCenterAnchors_data()
void tst_QGraphicsAnchorLayout1::testCenterAnchors()
{
+ if (strcmp(QTest::currentDataTag(), "center, basic with invalid") == 0) {
+ QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor edges of different orientations");
+ QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor edges of different orientations");
+ QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor edges of different orientations");
+ QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
+ QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
+ QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
+ QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
+ QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
+ QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
+ } else if (strcmp(QTest::currentDataTag(), "center, three") == 0) {
+ QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
+ QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
+ }
+
// use the same frame
testBasicLayout();
}
@@ -2144,11 +2147,6 @@ void tst_QGraphicsAnchorLayout1::testRemoveCenterAnchor_data()
<< BasicResult(1, QRectF(20, 0, 30, 10))
<< BasicResult(2, QRectF(60, 15, 40, 10));
- QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
- QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
- QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
- QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
-
QTest::newRow("remove, center, three") << QSizeF(100, 50) << theData << theRemoveData << theResult;
}
@@ -2183,8 +2181,6 @@ void tst_QGraphicsAnchorLayout1::testRemoveCenterAnchor_data()
theResult
<< BasicResult(0, QRectF(5, 5, 10, 10) );
- QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
- QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
QTest::newRow("remove, center, basic 2") << QSizeF(20, 20) << theData
<< theRemoveData << theResult;
}
@@ -2193,6 +2189,16 @@ void tst_QGraphicsAnchorLayout1::testRemoveCenterAnchor_data()
void tst_QGraphicsAnchorLayout1::testRemoveCenterAnchor()
{
+ if (strcmp(QTest::currentDataTag(), "remove, center, three") == 0) {
+ QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
+ QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
+ QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
+ QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
+ } else if (strcmp(QTest::currentDataTag(), "remove, center, basic 2") == 0) {
+ QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
+ QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself");
+ }
+
QFETCH(QSizeF, size);
QFETCH(BasicLayoutTestDataList, data);
QFETCH(BasicLayoutTestDataList, removeData);