diff options
Diffstat (limited to 'tests/auto/qtquick2/qquickanchors')
-rw-r--r-- | tests/auto/qtquick2/qquickanchors/data/centerin.qml | 6 | ||||
-rw-r--r-- | tests/auto/qtquick2/qquickanchors/tst_qquickanchors.cpp | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/tests/auto/qtquick2/qquickanchors/data/centerin.qml b/tests/auto/qtquick2/qquickanchors/data/centerin.qml index e5f64f1e47..e6c9179116 100644 --- a/tests/auto/qtquick2/qquickanchors/data/centerin.qml +++ b/tests/auto/qtquick2/qquickanchors/data/centerin.qml @@ -9,4 +9,10 @@ Rectangle { anchors.verticalCenterOffset: 30 anchors.horizontalCenterOffset: 10 } + + Rectangle { + objectName: "centered2" + width: 11; height: 11; color: "green" + anchors.centerIn: parent; + } } diff --git a/tests/auto/qtquick2/qquickanchors/tst_qquickanchors.cpp b/tests/auto/qtquick2/qquickanchors/tst_qquickanchors.cpp index ff3426bf13..d046f4e0a4 100644 --- a/tests/auto/qtquick2/qquickanchors/tst_qquickanchors.cpp +++ b/tests/auto/qtquick2/qquickanchors/tst_qquickanchors.cpp @@ -535,6 +535,11 @@ void tst_qquickanchors::centerIn() QCOMPARE(rect->x(), 75.0 - 20.0); QCOMPARE(rect->y(), 75.0 - 10.0); + //QTBUG-21730 (use actual center to prevent animation jitter) + QQuickRectangle* rect2 = findItem<QQuickRectangle>(view->rootObject(), QLatin1String("centered2")); + QCOMPARE(rect2->x(), 94.5); + QCOMPARE(rect2->y(), 94.5); + delete view; } @@ -567,7 +572,6 @@ void tst_qquickanchors::centerInRotation() QQuickRectangle* outer = findItem<QQuickRectangle>(view->rootObject(), QLatin1String("outer")); QQuickRectangle* inner = findItem<QQuickRectangle>(view->rootObject(), QLatin1String("inner")); - QEXPECT_FAIL("", "QTBUG-12441", Abort); QCOMPARE(outer->x(), qreal(49.5)); QCOMPARE(outer->y(), qreal(49.5)); QCOMPARE(inner->x(), qreal(25.5)); |