From: Matthew Cattell Date: Thu, 8 Sep 2011 14:46:54 +0000 (+0200) Subject: fixed autotest X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=589c8445e2623ef8e0b8294d7c558a2948b2a5e3;p=konrad%2Fqtdeclarative.git fixed autotest removed debug statements Change-Id: Id09e3a6a43b5d5170d8b50b10cc35eb8c4e1f3d0 Reviewed-on: http://codereview.qt-project.org/4472 Reviewed-by: Samuel Rødal --- diff --git a/tests/auto/declarative/qsgmousearea/tst_qsgmousearea.cpp b/tests/auto/declarative/qsgmousearea/tst_qsgmousearea.cpp index c3f3ba1..2f91f15 100644 --- a/tests/auto/declarative/qsgmousearea/tst_qsgmousearea.cpp +++ b/tests/auto/declarative/qsgmousearea/tst_qsgmousearea.cpp @@ -585,14 +585,9 @@ void tst_QSGMouseArea::preventStealing() // Without preventStealing, mouse movement over MouseArea would // cause the Flickable to steal mouse and trigger content movement. - QMouseEvent moveEvent(QEvent::MouseMove, QPoint(70, 70), Qt::LeftButton, Qt::LeftButton, 0); - QApplication::sendEvent(canvas, &moveEvent); - - moveEvent = QMouseEvent(QEvent::MouseMove, QPoint(60, 60), Qt::LeftButton, Qt::LeftButton, 0); - QApplication::sendEvent(canvas, &moveEvent); - - moveEvent = QMouseEvent(QEvent::MouseMove, QPoint(50, 50), Qt::LeftButton, Qt::LeftButton, 0); - QApplication::sendEvent(canvas, &moveEvent); + QTest::mouseMove(canvas,QPoint(69,69)); + QTest::mouseMove(canvas,QPoint(58,58)); + QTest::mouseMove(canvas,QPoint(47,47)); // We should have received all three move events QCOMPARE(mousePositionSpy.count(), 3); @@ -602,7 +597,7 @@ void tst_QSGMouseArea::preventStealing() QCOMPARE(flickable->contentX(), 0.); QCOMPARE(flickable->contentY(), 0.); - QTest::mouseRelease(canvas, Qt::LeftButton, 0, QPoint(50, 50)); + QTest::mouseRelease(canvas, Qt::LeftButton, 0, QPoint(47, 47)); // Now allow stealing and confirm Flickable does its thing. canvas->rootObject()->setProperty("stealing", false); @@ -611,14 +606,10 @@ void tst_QSGMouseArea::preventStealing() // Without preventStealing, mouse movement over MouseArea would // cause the Flickable to steal mouse and trigger content movement. - moveEvent = QMouseEvent(QEvent::MouseMove, QPoint(70, 70), Qt::LeftButton, Qt::LeftButton, 0); - QApplication::sendEvent(canvas, &moveEvent); - - moveEvent = QMouseEvent(QEvent::MouseMove, QPoint(60, 60), Qt::LeftButton, Qt::LeftButton, 0); - QApplication::sendEvent(canvas, &moveEvent); - moveEvent = QMouseEvent(QEvent::MouseMove, QPoint(50, 50), Qt::LeftButton, Qt::LeftButton, 0); - QApplication::sendEvent(canvas, &moveEvent); + QTest::mouseMove(canvas,QPoint(69,69)); + QTest::mouseMove(canvas,QPoint(58,58)); + QTest::mouseMove(canvas,QPoint(47,47)); // We should only have received the first move event QCOMPARE(mousePositionSpy.count(), 4); @@ -626,8 +617,9 @@ void tst_QSGMouseArea::preventStealing() QVERIFY(!mouseArea->pressed()); // Flickable content should have moved. - QCOMPARE(flickable->contentX(), 10.); - QCOMPARE(flickable->contentY(), 10.); + + QCOMPARE(flickable->contentX(), 11.); + QCOMPARE(flickable->contentY(), 11.); QTest::mouseRelease(canvas, Qt::LeftButton, 0, QPoint(50, 50)); @@ -790,12 +782,9 @@ void tst_QSGMouseArea::hoverPosition() QCOMPARE(root->property("mouseX").toReal(), qreal(0)); QCOMPARE(root->property("mouseY").toReal(), qreal(0)); - QMouseEvent moveEvent(QEvent::MouseMove, QPoint(10, 32), Qt::NoButton, Qt::NoButton, 0); - QApplication::sendEvent(canvas, &moveEvent); + QTest::mouseMove(canvas,QPoint(10,32)); + -#ifdef Q_WS_QPA - QEXPECT_FAIL("", "QTBUG-21008 fails", Abort); -#endif QCOMPARE(root->property("mouseX").toReal(), qreal(10)); QCOMPARE(root->property("mouseY").toReal(), qreal(32)); @@ -816,9 +805,7 @@ void tst_QSGMouseArea::hoverPropagation() QMouseEvent moveEvent(QEvent::MouseMove, QPoint(32, 32), Qt::NoButton, Qt::NoButton, 0); QApplication::sendEvent(canvas, &moveEvent); -#ifdef Q_WS_QPA - QEXPECT_FAIL("", "QTBUG-21008 fails", Abort); -#endif + QCOMPARE(root->property("point1").toBool(), true); QCOMPARE(root->property("point2").toBool(), false);