summaryrefslogtreecommitdiff
path: root/tests/auto/quick/qquickfocusscope
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-07-24 13:39:05 +0200
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-07-27 12:32:49 +0000
commit0959281be22c2d3317f010ac117010fdf990df7a (patch)
treeb2f78384612972d0ea7b8f5220674f48d9b3628f /tests/auto/quick/qquickfocusscope
parentfb9c53eef298d943706eb1d508c7f72a57c42249 (diff)
downloadqtdeclarative-0959281be22c2d3317f010ac117010fdf990df7a.tar.gz
Tests: Replace Q[TRY]_VERIFY(v == true|false) by QVERIFY(v)|QVERIFY(!v).
Preparing the replacement of Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) for non-boolean types. Change-Id: I8a4e44a2b4e20a9c8b811799e3932c8ce1a2cbbb Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests/auto/quick/qquickfocusscope')
-rw-r--r--tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp136
1 files changed, 68 insertions, 68 deletions
diff --git a/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp b/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp
index 98f85af92e..76e33dae11 100644
--- a/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp
+++ b/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp
@@ -84,24 +84,24 @@ void tst_qquickfocusscope::basic()
QTRY_VERIFY(view == qGuiApp->focusWindow());
QVERIFY(view->isTopLevel());
- QVERIFY(item0->hasActiveFocus() == true);
- QVERIFY(item1->hasActiveFocus() == true);
- QVERIFY(item2->hasActiveFocus() == false);
- QVERIFY(item3->hasActiveFocus() == false);
+ QVERIFY(item0->hasActiveFocus());
+ QVERIFY(item1->hasActiveFocus());
+ QVERIFY(!item2->hasActiveFocus());
+ QVERIFY(!item3->hasActiveFocus());
QTest::keyClick(view, Qt::Key_Right);
QTest::qWait(50);
- QVERIFY(item0->hasActiveFocus() == true);
- QVERIFY(item1->hasActiveFocus() == false);
- QVERIFY(item2->hasActiveFocus() == true);
- QVERIFY(item3->hasActiveFocus() == false);
+ QVERIFY(item0->hasActiveFocus());
+ QVERIFY(!item1->hasActiveFocus());
+ QVERIFY(item2->hasActiveFocus());
+ QVERIFY(!item3->hasActiveFocus());
QTest::keyClick(view, Qt::Key_Down);
QTest::qWait(50);
- QVERIFY(item0->hasActiveFocus() == false);
- QVERIFY(item1->hasActiveFocus() == false);
- QVERIFY(item2->hasActiveFocus() == false);
- QVERIFY(item3->hasActiveFocus() == true);
+ QVERIFY(!item0->hasActiveFocus());
+ QVERIFY(!item1->hasActiveFocus());
+ QVERIFY(!item2->hasActiveFocus());
+ QVERIFY(item3->hasActiveFocus());
delete view;
}
@@ -128,11 +128,11 @@ void tst_qquickfocusscope::nested()
QTest::qWaitForWindowActive(view);
QTRY_VERIFY(view == qGuiApp->focusWindow());
- QVERIFY(item1->hasActiveFocus() == true);
- QVERIFY(item2->hasActiveFocus() == true);
- QVERIFY(item3->hasActiveFocus() == true);
- QVERIFY(item4->hasActiveFocus() == true);
- QVERIFY(item5->hasActiveFocus() == true);
+ QVERIFY(item1->hasActiveFocus());
+ QVERIFY(item2->hasActiveFocus());
+ QVERIFY(item3->hasActiveFocus());
+ QVERIFY(item4->hasActiveFocus());
+ QVERIFY(item5->hasActiveFocus());
delete view;
}
@@ -155,22 +155,22 @@ void tst_qquickfocusscope::noFocus()
QVERIFY(QTest::qWaitForWindowActive(view));
QVERIFY(view == qGuiApp->focusWindow());
- QVERIFY(item0->hasActiveFocus() == false);
- QVERIFY(item1->hasActiveFocus() == false);
- QVERIFY(item2->hasActiveFocus() == false);
- QVERIFY(item3->hasActiveFocus() == false);
+ QVERIFY(!item0->hasActiveFocus());
+ QVERIFY(!item1->hasActiveFocus());
+ QVERIFY(!item2->hasActiveFocus());
+ QVERIFY(!item3->hasActiveFocus());
QTest::keyClick(view, Qt::Key_Right);
- QVERIFY(item0->hasActiveFocus() == false);
- QVERIFY(item1->hasActiveFocus() == false);
- QVERIFY(item2->hasActiveFocus() == false);
- QVERIFY(item3->hasActiveFocus() == false);
+ QVERIFY(!item0->hasActiveFocus());
+ QVERIFY(!item1->hasActiveFocus());
+ QVERIFY(!item2->hasActiveFocus());
+ QVERIFY(!item3->hasActiveFocus());
QTest::keyClick(view, Qt::Key_Down);
- QVERIFY(item0->hasActiveFocus() == false);
- QVERIFY(item1->hasActiveFocus() == false);
- QVERIFY(item2->hasActiveFocus() == false);
- QVERIFY(item3->hasActiveFocus() == false);
+ QVERIFY(!item0->hasActiveFocus());
+ QVERIFY(!item1->hasActiveFocus());
+ QVERIFY(!item2->hasActiveFocus());
+ QVERIFY(!item3->hasActiveFocus());
delete view;
}
@@ -195,32 +195,32 @@ void tst_qquickfocusscope::textEdit()
QTest::qWaitForWindowActive(view);
QTRY_VERIFY(view == qGuiApp->focusWindow());
- QVERIFY(item0->hasActiveFocus() == true);
- QVERIFY(item1->hasActiveFocus() == true);
- QVERIFY(item2->hasActiveFocus() == false);
- QVERIFY(item3->hasActiveFocus() == false);
+ QVERIFY(item0->hasActiveFocus());
+ QVERIFY(item1->hasActiveFocus());
+ QVERIFY(!item2->hasActiveFocus());
+ QVERIFY(!item3->hasActiveFocus());
QTest::keyClick(view, Qt::Key_Right);
- QVERIFY(item0->hasActiveFocus() == true);
- QVERIFY(item1->hasActiveFocus() == true);
- QVERIFY(item2->hasActiveFocus() == false);
- QVERIFY(item3->hasActiveFocus() == false);
+ QVERIFY(item0->hasActiveFocus());
+ QVERIFY(item1->hasActiveFocus());
+ QVERIFY(!item2->hasActiveFocus());
+ QVERIFY(!item3->hasActiveFocus());
QTest::keyClick(view, Qt::Key_Right);
QTest::keyClick(view, Qt::Key_Right);
QTest::keyClick(view, Qt::Key_Right);
QTest::keyClick(view, Qt::Key_Right);
QTest::keyClick(view, Qt::Key_Right);
- QVERIFY(item0->hasActiveFocus() == true);
- QVERIFY(item1->hasActiveFocus() == false);
- QVERIFY(item2->hasActiveFocus() == true);
- QVERIFY(item3->hasActiveFocus() == false);
+ QVERIFY(item0->hasActiveFocus());
+ QVERIFY(!item1->hasActiveFocus());
+ QVERIFY(item2->hasActiveFocus());
+ QVERIFY(!item3->hasActiveFocus());
QTest::keyClick(view, Qt::Key_Down);
- QVERIFY(item0->hasActiveFocus() == false);
- QVERIFY(item1->hasActiveFocus() == false);
- QVERIFY(item2->hasActiveFocus() == false);
- QVERIFY(item3->hasActiveFocus() == true);
+ QVERIFY(!item0->hasActiveFocus());
+ QVERIFY(!item1->hasActiveFocus());
+ QVERIFY(!item2->hasActiveFocus());
+ QVERIFY(item3->hasActiveFocus());
delete view;
}
@@ -248,28 +248,28 @@ void tst_qquickfocusscope::forceFocus()
QTest::qWaitForWindowActive(view);
QTRY_VERIFY(view == qGuiApp->focusWindow());
- QVERIFY(item0->hasActiveFocus() == true);
- QVERIFY(item1->hasActiveFocus() == true);
- QVERIFY(item2->hasActiveFocus() == false);
- QVERIFY(item3->hasActiveFocus() == false);
- QVERIFY(item4->hasActiveFocus() == false);
- QVERIFY(item5->hasActiveFocus() == false);
+ QVERIFY(item0->hasActiveFocus());
+ QVERIFY(item1->hasActiveFocus());
+ QVERIFY(!item2->hasActiveFocus());
+ QVERIFY(!item3->hasActiveFocus());
+ QVERIFY(!item4->hasActiveFocus());
+ QVERIFY(!item5->hasActiveFocus());
QTest::keyClick(view, Qt::Key_4);
- QVERIFY(item0->hasActiveFocus() == true);
- QVERIFY(item1->hasActiveFocus() == true);
- QVERIFY(item2->hasActiveFocus() == false);
- QVERIFY(item3->hasActiveFocus() == false);
- QVERIFY(item4->hasActiveFocus() == false);
- QVERIFY(item5->hasActiveFocus() == false);
+ QVERIFY(item0->hasActiveFocus());
+ QVERIFY(item1->hasActiveFocus());
+ QVERIFY(!item2->hasActiveFocus());
+ QVERIFY(!item3->hasActiveFocus());
+ QVERIFY(!item4->hasActiveFocus());
+ QVERIFY(!item5->hasActiveFocus());
QTest::keyClick(view, Qt::Key_5);
- QVERIFY(item0->hasActiveFocus() == false);
- QVERIFY(item1->hasActiveFocus() == false);
- QVERIFY(item2->hasActiveFocus() == false);
- QVERIFY(item3->hasActiveFocus() == true);
- QVERIFY(item4->hasActiveFocus() == false);
- QVERIFY(item5->hasActiveFocus() == true);
+ QVERIFY(!item0->hasActiveFocus());
+ QVERIFY(!item1->hasActiveFocus());
+ QVERIFY(!item2->hasActiveFocus());
+ QVERIFY(item3->hasActiveFocus());
+ QVERIFY(!item4->hasActiveFocus());
+ QVERIFY(item5->hasActiveFocus());
delete view;
}
@@ -285,11 +285,11 @@ void tst_qquickfocusscope::noParentFocus()
QTest::qWaitForWindowActive(view);
QTRY_VERIFY(view == qGuiApp->focusWindow());
- QVERIFY(view->rootObject()->property("focus1") == false);
- QVERIFY(view->rootObject()->property("focus2") == false);
- QVERIFY(view->rootObject()->property("focus3") == true);
- QVERIFY(view->rootObject()->property("focus4") == true);
- QVERIFY(view->rootObject()->property("focus5") == true);
+ QVERIFY(!view->rootObject()->property("focus1").toBool());
+ QVERIFY(!view->rootObject()->property("focus2").toBool());
+ QVERIFY(view->rootObject()->property("focus3").toBool());
+ QVERIFY(view->rootObject()->property("focus4").toBool());
+ QVERIFY(view->rootObject()->property("focus5").toBool());
delete view;
}