diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2016-07-28 18:26:54 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2016-07-28 17:49:53 +0000 |
commit | 05d7fb5bd261746f4fc5ed5c23fd0b1bb8f3c087 (patch) | |
tree | 13d7d76c02e1e76b1923345f3e1ecd428df299e7 /tests/auto/quick/qquickmousearea | |
parent | 84d6defe81bdd67dc986f3179927ff4c72d75d66 (diff) |
Prefer QCOMPARE over QVERIFY
Change-Id: Id57e576653cd66d1b36685737ba477c8b3ff6258
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'tests/auto/quick/qquickmousearea')
-rw-r--r-- | tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp index 0ef17267b7..adf0d282c5 100644 --- a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp +++ b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp @@ -1904,9 +1904,9 @@ void tst_QQuickMouseArea::ignoreBySource() // MouseArea should grab the press because it's interested in non-synthesized mouse events QPoint p = QPoint(80, 80); QTest::mousePress(&window, Qt::LeftButton, 0, p); - QVERIFY(window.mouseGrabberItem() == mouseArea); + QCOMPARE(window.mouseGrabberItem(), mouseArea); // That was a real mouse event - QVERIFY(root->property("lastEventSource").toInt() == Qt::MouseEventNotSynthesized); + QCOMPARE(root->property("lastEventSource").toInt(), int(Qt::MouseEventNotSynthesized)); // Flickable content should not move p -= QPoint(startDragDistance() + 1, startDragDistance() + 1); @@ -1919,12 +1919,14 @@ void tst_QQuickMouseArea::ignoreBySource() QCOMPARE(flickable->contentY(), 0.); QTest::mouseRelease(&window, Qt::LeftButton, 0, p); + QCOMPARE(window.mouseGrabberItem(), nullptr); // Now try touch events and confirm that MouseArea ignores them, while Flickable does its thing p = QPoint(80, 80); QTest::touchEvent(&window, device).press(0, p, &window); QQuickTouchUtils::flush(&window); - QVERIFY(window.mouseGrabberItem() != mouseArea); + QCOMPARE(window.mouseGrabberItem(), flickable); + // That was a fake mouse event QCOMPARE(root->property("lastEventSource").toInt(), int(Qt::MouseEventSynthesizedByQt)); p -= QPoint(startDragDistance() + 1, startDragDistance() + 1); |