Tests: Replace Q[TRY]_VERIFY(v == true|false) by QVERIFY(v)|QVERIFY(!v).
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Fri, 24 Jul 2015 11:39:05 +0000 (13:39 +0200)
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Mon, 27 Jul 2015 12:32:49 +0000 (12:32 +0000)
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>
21 files changed:
tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp
tests/auto/qml/qqmltimer/tst_qqmltimer.cpp
tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp
tests/auto/quick/qquickanimations/tst_qquickanimations.cpp
tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp
tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
tests/auto/quick/qquickimage/tst_qquickimage.cpp
tests/auto/quick/qquickitem2/tst_qquickitem.cpp
tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp
tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp
tests/auto/quick/qquicktext/tst_qquicktext.cpp
tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
tests/auto/quick/qquickwindow/tst_qquickwindow.cpp

index 4c1f82791513989747f21b20e46f3afd624394f6..dddd9a7dc80c30b0b60de934e617096bedd6684d 100644 (file)
@@ -158,7 +158,7 @@ void tst_qqmlcomponent::qmlIncubateObject()
     QCOMPARE(object->property("test1").toBool(), true);
     QCOMPARE(object->property("test2").toBool(), false);
 
-    QTRY_VERIFY(object->property("test2").toBool() == true);
+    QTRY_VERIFY(object->property("test2").toBool());
 
     delete object;
 }
index 45393bf2f05001a871583d9be6bde6cbb2095449..c7781c2e9d02e41ce540226d486d9a27df3c1b49 100644 (file)
@@ -211,7 +211,7 @@ void tst_qqmlconnections::errors()
 
     QQmlEngine engine;
     QQmlComponent c(&engine, url);
-    QVERIFY(c.isError() == true);
+    QVERIFY(c.isError());
     QList<QQmlError> errors = c.errors();
     QVERIFY(errors.count() == 1);
     QCOMPARE(errors.at(0).description(), error);
index eb25eb70f4eebb4c44236c6e67f7e88f94dff6d4..78c4022322bfe05b1004509f85ab5957a58750c6 100644 (file)
@@ -1750,9 +1750,9 @@ void tst_qqmlecmascript::objectHasOwnProperty()
 
     // test QObjects in QML
     QMetaObject::invokeMethod(object, "testHasOwnPropertySuccess");
-    QVERIFY(object->property("result").value<bool>() == true);
+    QVERIFY(object->property("result").value<bool>());
     QMetaObject::invokeMethod(object, "testHasOwnPropertyFailure");
-    QVERIFY(object->property("result").value<bool>() == false);
+    QVERIFY(!object->property("result").value<bool>());
 
     // now test other types in QML
     QObject *child = object->findChild<QObject*>("typeObj");
@@ -3929,7 +3929,7 @@ void tst_qqmlecmascript::singletonTypeResolution()
     QQmlComponent component(&engine, testFileUrl("singletontype/singletonTypeResolution.qml"));
     QObject *object = component.create();
     QVERIFY(object);
-    QVERIFY(object->property("success") == true);
+    QVERIFY(object->property("success").toBool());
     delete object;
 }
 
@@ -6064,7 +6064,7 @@ void tst_qqmlecmascript::include()
     o->setProperty("serverBaseUrl", server.baseUrl().toString());
     component.completeCreate();
 
-    QTRY_VERIFY(o->property("done").toBool() == true);
+    QTRY_VERIFY(o->property("done").toBool());
 
     QCOMPARE(o->property("test1").toBool(), true);
     QCOMPARE(o->property("test2").toBool(), true);
@@ -6108,8 +6108,8 @@ void tst_qqmlecmascript::includeRemoteSuccess()
     o->setProperty("serverBaseUrl", server.baseUrl().toString());
     component.completeCreate();
 
-    QTRY_VERIFY(o->property("done").toBool() == true);
-    QTRY_VERIFY(o->property("done2").toBool() == true);
+    QTRY_VERIFY(o->property("done").toBool());
+    QTRY_VERIFY(o->property("done2").toBool());
 
     QCOMPARE(o->property("test1").toBool(), true);
     QCOMPARE(o->property("test2").toBool(), true);
@@ -7032,7 +7032,7 @@ void tst_qqmlecmascript::invokableWithQObjectDerived()
     QObject *object = component.create();
 
     QVERIFY(object != 0);
-    QVERIFY(object->property("result").value<bool>() == true);
+    QVERIFY(object->property("result").value<bool>());
 
     delete object;
     }
@@ -7344,7 +7344,7 @@ void tst_qqmlecmascript::sequenceSort()
 
     QVariant q;
     QMetaObject::invokeMethod(object, function.toAscii().constData(), Q_RETURN_ARG(QVariant, q), Q_ARG(QVariant, useComparer));
-    QVERIFY(q.toBool() == true);
+    QVERIFY(q.toBool());
 
     delete object;
 }
@@ -7360,10 +7360,10 @@ void tst_qqmlecmascript::dateParse()
 
     QVariant q;
     QMetaObject::invokeMethod(object, "test_is_invalid_jsDateTime", Q_RETURN_ARG(QVariant, q));
-    QVERIFY(q.toBool() == true);
+    QVERIFY(q.toBool());
 
     QMetaObject::invokeMethod(object, "test_is_invalid_qtDateTime", Q_RETURN_ARG(QVariant, q));
-    QVERIFY(q.toBool() == true);
+    QVERIFY(q.toBool());
 
     QMetaObject::invokeMethod(object, "test_rfc2822_date", Q_RETURN_ARG(QVariant, q));
     QCOMPARE(q.toLongLong(), 1379512851000LL);
@@ -7381,7 +7381,7 @@ void tst_qqmlecmascript::utcDate()
     QVariant q;
     QVariant val = QString::fromLatin1("2014-07-16T23:30:31");
     QMetaObject::invokeMethod(object, "check_utc", Q_RETURN_ARG(QVariant, q), Q_ARG(QVariant, val));
-    QVERIFY(q.toBool() == true);
+    QVERIFY(q.toBool());
 }
 
 void tst_qqmlecmascript::negativeYear()
@@ -7611,13 +7611,13 @@ void tst_qqmlecmascript::miscTypeTest()
 
     QVariant q;
     QMetaObject::invokeMethod(object, "test_invalid_url_equal", Q_RETURN_ARG(QVariant, q));
-    QVERIFY(q.toBool() == true);
+    QVERIFY(q.toBool());
     QMetaObject::invokeMethod(object, "test_invalid_url_strictequal", Q_RETURN_ARG(QVariant, q));
-    QVERIFY(q.toBool() == true);
+    QVERIFY(q.toBool());
     QMetaObject::invokeMethod(object, "test_valid_url_equal", Q_RETURN_ARG(QVariant, q));
-    QVERIFY(q.toBool() == true);
+    QVERIFY(q.toBool());
     QMetaObject::invokeMethod(object, "test_valid_url_strictequal", Q_RETURN_ARG(QVariant, q));
-    QVERIFY(q.toBool() == true);
+    QVERIFY(q.toBool());
 
     delete object;
 }
@@ -7688,7 +7688,7 @@ void tst_qqmlecmascript::varPropertyAccessOnObjectWithInvalidContext()
    if (obj.isNull())
        qDebug() << component.errors().first().toString();
    QVERIFY(!obj.isNull());
-   QVERIFY(obj->property("success") == true);
+   QVERIFY(obj->property("success").toBool());
 }
 
 void tst_qqmlecmascript::importedScriptsAccessOnObjectWithInvalidContext()
@@ -7698,7 +7698,7 @@ void tst_qqmlecmascript::importedScriptsAccessOnObjectWithInvalidContext()
    if (obj.isNull())
        qDebug() << component.errors().first().toString();
    QVERIFY(!obj.isNull());
-   QTRY_VERIFY(obj->property("success") == true);
+   QTRY_VERIFY(obj->property("success").toBool());
 }
 
 void tst_qqmlecmascript::importedScriptsWithoutQmlMode()
@@ -7708,7 +7708,7 @@ void tst_qqmlecmascript::importedScriptsWithoutQmlMode()
    if (obj.isNull())
        qDebug() << component.errors().first().toString();
    QVERIFY(!obj.isNull());
-   QTRY_VERIFY(obj->property("success") == true);
+   QTRY_VERIFY(obj->property("success").toBool());
 }
 
 void tst_qqmlecmascript::contextObjectOnLazyBindings()
index eac648ef1507baedf2ba5b337a97cd3495dacd77..2cefb6bf3f3f3e6a0d79d738f7dc4c8e81e1865d 100644 (file)
@@ -470,7 +470,7 @@ void tst_qqmlengine::outputWarningsToStandardError()
     QQmlComponent c(&engine);
     c.setData("import QtQuick 2.0; QtObject { property int a: undefined }", QUrl());
 
-    QVERIFY(c.isReady() == true);
+    QVERIFY(c.isReady());
 
     QQmlTestMessageHandler messageHandler;
 
index b5963e2f717cdc34b2f7dc07d29a02af8ff1c445..012080a5d9151461997a126a46564d3c408a950d 100644 (file)
@@ -98,7 +98,7 @@ void tst_qqmllistreference::qmllistreference()
     TestType tt;
 
     QQmlListReference r(&tt, "data");
-    QVERIFY(r.isValid() == true);
+    QVERIFY(r.isValid());
     QCOMPARE(r.count(), 0);
 
     tt.data.append(&tt);
@@ -112,52 +112,52 @@ void tst_qqmllistreference::qmllistreference_invalid()
     // Invalid
     {
     QQmlListReference r;
-    QVERIFY(r.isValid() == false);
+    QVERIFY(!r.isValid());
     QVERIFY(r.object() == 0);
     QVERIFY(r.listElementType() == 0);
-    QVERIFY(r.canAt() == false);
-    QVERIFY(r.canClear() == false);
-    QVERIFY(r.canCount() == false);
-    QVERIFY(r.append(0) == false);
+    QVERIFY(!r.canAt());
+    QVERIFY(!r.canClear());
+    QVERIFY(!r.canCount());
+    QVERIFY(!r.append(0));
     QVERIFY(r.at(10) == 0);
-    QVERIFY(r.clear() == false);
+    QVERIFY(!r.clear());
     QVERIFY(r.count() == 0);
-    QVERIFY(r.isReadable() == false);
-    QVERIFY(r.isManipulable() == false);
+    QVERIFY(!r.isReadable());
+    QVERIFY(!r.isManipulable());
     }
 
     // Non-property
     {
     QQmlListReference r(&tt, "blah");
-    QVERIFY(r.isValid() == false);
+    QVERIFY(!r.isValid());
     QVERIFY(r.object() == 0);
     QVERIFY(r.listElementType() == 0);
-    QVERIFY(r.canAt() == false);
-    QVERIFY(r.canClear() == false);
-    QVERIFY(r.canCount() == false);
-    QVERIFY(r.append(0) == false);
+    QVERIFY(!r.canAt());
+    QVERIFY(!r.canClear());
+    QVERIFY(!r.canCount());
+    QVERIFY(!r.append(0));
     QVERIFY(r.at(10) == 0);
-    QVERIFY(r.clear() == false);
+    QVERIFY(!r.clear());
     QVERIFY(r.count() == 0);
-    QVERIFY(r.isReadable() == false);
-    QVERIFY(r.isManipulable() == false);
+    QVERIFY(!r.isReadable());
+    QVERIFY(!r.isManipulable());
     }
 
     // Non-list property
     {
     QQmlListReference r(&tt, "intProperty");
-    QVERIFY(r.isValid() == false);
+    QVERIFY(!r.isValid());
     QVERIFY(r.object() == 0);
     QVERIFY(r.listElementType() == 0);
-    QVERIFY(r.canAt() == false);
-    QVERIFY(r.canClear() == false);
-    QVERIFY(r.canCount() == false);
-    QVERIFY(r.append(0) == false);
+    QVERIFY(!r.canAt());
+    QVERIFY(!r.canClear());
+    QVERIFY(!r.canCount());
+    QVERIFY(!r.append(0));
     QVERIFY(r.at(10) == 0);
-    QVERIFY(r.clear() == false);
+    QVERIFY(!r.clear());
     QVERIFY(r.count() == 0);
-    QVERIFY(r.isReadable() == false);
-    QVERIFY(r.isManipulable() == false);
+    QVERIFY(!r.isReadable());
+    QVERIFY(!r.isManipulable());
     }
 }
 
@@ -167,19 +167,19 @@ void tst_qqmllistreference::isValid()
 
     {
     QQmlListReference ref;
-    QVERIFY(ref.isValid() == false);
+    QVERIFY(!ref.isValid());
     }
 
     {
     QQmlListReference ref(tt, "blah");
-    QVERIFY(ref.isValid() == false);
+    QVERIFY(!ref.isValid());
     }
 
     {
     QQmlListReference ref(tt, "data");
-    QVERIFY(ref.isValid() == true);
+    QVERIFY(ref.isValid());
     delete tt;
-    QVERIFY(ref.isValid() == false);
+    QVERIFY(!ref.isValid());
     }
 }
 
@@ -233,26 +233,26 @@ void tst_qqmllistreference::canAppend()
 
     {
     QQmlListReference ref;
-    QVERIFY(ref.canAppend() == false);
+    QVERIFY(!ref.canAppend());
     }
 
     {
     QQmlListReference ref(tt, "blah");
-    QVERIFY(ref.canAppend() == false);
+    QVERIFY(!ref.canAppend());
     }
 
     {
     QQmlListReference ref(tt, "data");
-    QVERIFY(ref.canAppend() == true);
+    QVERIFY(ref.canAppend());
     delete tt;
-    QVERIFY(ref.canAppend() == false);
+    QVERIFY(!ref.canAppend());
     }
 
     {
     TestType tt;
     tt.property.append = 0;
     QQmlListReference ref(&tt, "data");
-    QVERIFY(ref.canAppend() == false);
+    QVERIFY(!ref.canAppend());
     }
 }
 
@@ -262,26 +262,26 @@ void tst_qqmllistreference::canAt()
 
     {
     QQmlListReference ref;
-    QVERIFY(ref.canAt() == false);
+    QVERIFY(!ref.canAt());
     }
 
     {
     QQmlListReference ref(tt, "blah");
-    QVERIFY(ref.canAt() == false);
+    QVERIFY(!ref.canAt());
     }
 
     {
     QQmlListReference ref(tt, "data");
-    QVERIFY(ref.canAt() == true);
+    QVERIFY(ref.canAt());
     delete tt;
-    QVERIFY(ref.canAt() == false);
+    QVERIFY(!ref.canAt());
     }
 
     {
     TestType tt;
     tt.property.at = 0;
     QQmlListReference ref(&tt, "data");
-    QVERIFY(ref.canAt() == false);
+    QVERIFY(!ref.canAt());
     }
 }
 
@@ -291,26 +291,26 @@ void tst_qqmllistreference::canClear()
 
     {
     QQmlListReference ref;
-    QVERIFY(ref.canClear() == false);
+    QVERIFY(!ref.canClear());
     }
 
     {
     QQmlListReference ref(tt, "blah");
-    QVERIFY(ref.canClear() == false);
+    QVERIFY(!ref.canClear());
     }
 
     {
     QQmlListReference ref(tt, "data");
-    QVERIFY(ref.canClear() == true);
+    QVERIFY(ref.canClear());
     delete tt;
-    QVERIFY(ref.canClear() == false);
+    QVERIFY(!ref.canClear());
     }
 
     {
     TestType tt;
     tt.property.clear = 0;
     QQmlListReference ref(&tt, "data");
-    QVERIFY(ref.canClear() == false);
+    QVERIFY(!ref.canClear());
     }
 }
 
@@ -320,26 +320,26 @@ void tst_qqmllistreference::canCount()
 
     {
     QQmlListReference ref;
-    QVERIFY(ref.canCount() == false);
+    QVERIFY(!ref.canCount());
     }
 
     {
     QQmlListReference ref(tt, "blah");
-    QVERIFY(ref.canCount() == false);
+    QVERIFY(!ref.canCount());
     }
 
     {
     QQmlListReference ref(tt, "data");
-    QVERIFY(ref.canCount() == true);
+    QVERIFY(ref.canCount());
     delete tt;
-    QVERIFY(ref.canCount() == false);
+    QVERIFY(!ref.canCount());
     }
 
     {
     TestType tt;
     tt.property.count = 0;
     QQmlListReference ref(&tt, "data");
-    QVERIFY(ref.canCount() == false);
+    QVERIFY(!ref.canCount());
     }
 }
 
@@ -349,26 +349,26 @@ void tst_qqmllistreference::isReadable()
 
     {
     QQmlListReference ref;
-    QVERIFY(ref.isReadable() == false);
+    QVERIFY(!ref.isReadable());
     }
 
     {
     QQmlListReference ref(tt, "blah");
-    QVERIFY(ref.isReadable() == false);
+    QVERIFY(!ref.isReadable());
     }
 
     {
     QQmlListReference ref(tt, "data");
-    QVERIFY(ref.isReadable() == true);
+    QVERIFY(ref.isReadable());
     delete tt;
-    QVERIFY(ref.isReadable() == false);
+    QVERIFY(!ref.isReadable());
     }
 
     {
     TestType tt;
     tt.property.count = 0;
     QQmlListReference ref(&tt, "data");
-    QVERIFY(ref.isReadable() == false);
+    QVERIFY(!ref.isReadable());
     }
 }
 
@@ -378,26 +378,26 @@ void tst_qqmllistreference::isManipulable()
 
     {
     QQmlListReference ref;
-    QVERIFY(ref.isManipulable() == false);
+    QVERIFY(!ref.isManipulable());
     }
 
     {
     QQmlListReference ref(tt, "blah");
-    QVERIFY(ref.isManipulable() == false);
+    QVERIFY(!ref.isManipulable());
     }
 
     {
     QQmlListReference ref(tt, "data");
-    QVERIFY(ref.isManipulable() == true);
+    QVERIFY(ref.isManipulable());
     delete tt;
-    QVERIFY(ref.isManipulable() == false);
+    QVERIFY(!ref.isManipulable());
     }
 
     {
     TestType tt;
     tt.property.count = 0;
     QQmlListReference ref(&tt, "data");
-    QVERIFY(ref.isManipulable() == false);
+    QVERIFY(!ref.isManipulable());
     }
 }
 
@@ -408,35 +408,35 @@ void tst_qqmllistreference::append()
 
     {
     QQmlListReference ref;
-    QVERIFY(ref.append(tt) == false);
+    QVERIFY(!ref.append(tt));
     }
 
     {
     QQmlListReference ref(tt, "blah");
-    QVERIFY(ref.append(tt) == false);
+    QVERIFY(!ref.append(tt));
     }
 
     {
     QQmlListReference ref(tt, "data");
-    QVERIFY(ref.append(tt) == true);
+    QVERIFY(ref.append(tt));
     QVERIFY(tt->data.count() == 1);
     QVERIFY(tt->data.at(0) == tt);
-    QVERIFY(ref.append(&object) == false);
+    QVERIFY(!ref.append(&object));
     QVERIFY(tt->data.count() == 1);
     QVERIFY(tt->data.at(0) == tt);
-    QVERIFY(ref.append(0) == true);
+    QVERIFY(ref.append(0));
     QVERIFY(tt->data.count() == 2);
     QVERIFY(tt->data.at(0) == tt);
     QVERIFY(tt->data.at(1) == 0);
     delete tt;
-    QVERIFY(ref.append(0) == false);
+    QVERIFY(!ref.append(0));
     }
 
     {
     TestType tt;
     tt.property.append = 0;
     QQmlListReference ref(&tt, "data");
-    QVERIFY(ref.append(&tt) == false);
+    QVERIFY(!ref.append(&tt));
     }
 }
 
@@ -484,27 +484,27 @@ void tst_qqmllistreference::clear()
 
     {
     QQmlListReference ref;
-    QVERIFY(ref.clear() == false);
+    QVERIFY(!ref.clear());
     }
 
     {
     QQmlListReference ref(tt, "blah");
-    QVERIFY(ref.clear() == false);
+    QVERIFY(!ref.clear());
     }
 
     {
     QQmlListReference ref(tt, "data");
-    QVERIFY(ref.clear() == true);
+    QVERIFY(ref.clear());
     QVERIFY(tt->data.count() == 0);
     delete tt;
-    QVERIFY(ref.clear() == false);
+    QVERIFY(!ref.clear());
     }
 
     {
     TestType tt;
     tt.property.clear = 0;
     QQmlListReference ref(&tt, "data");
-    QVERIFY(ref.clear() == false);
+    QVERIFY(!ref.clear());
     }
 }
 
index 17083a4c6a0cb62383c67c7a1b2b6cb2aedafcdc..8c0f280116e8d6b5455cbab99ba1a36d5378c399 100644 (file)
@@ -134,7 +134,7 @@ void tst_qqmltimer::notRepeating()
     QCOMPARE(helper.count, 1);
     consistentWait(200);
     QCOMPARE(helper.count, 1);
-    QVERIFY(timer->isRunning() == false);
+    QVERIFY(!timer->isRunning());
 }
 
 void tst_qqmltimer::notRepeatingStart()
@@ -157,7 +157,7 @@ void tst_qqmltimer::notRepeatingStart()
     QCOMPARE(helper.count, 1);
     consistentWait(200);
     QCOMPARE(helper.count, 1);
-    QVERIFY(timer->isRunning() == false);
+    QVERIFY(!timer->isRunning());
 
     delete timer;
 }
@@ -187,7 +187,7 @@ void tst_qqmltimer::repeat()
 
     consistentWait(200);
     QVERIFY(helper.count == oldCount);
-    QVERIFY(timer->isRunning() == false);
+    QVERIFY(!timer->isRunning());
 
     QSignalSpy spy(timer, SIGNAL(repeatChanged()));
 
@@ -221,7 +221,7 @@ void tst_qqmltimer::triggeredOnStart()
     QCOMPARE(helper.count, 2);
     consistentWait(200);
     QCOMPARE(helper.count, 2);
-    QVERIFY(timer->isRunning() == false);
+    QVERIFY(!timer->isRunning());
 
     QSignalSpy spy(timer, SIGNAL(triggeredOnStartChanged()));
 
index d7f0d3bb794fb04e3573ddc395387be20a6046a5..22f321654ce5c8933599a2d2ab752bcb8cd24ee0 100644 (file)
@@ -177,7 +177,7 @@ void tst_qqmlxmlhttprequest::callbackException()
     object->setProperty("which", which);
     component.completeCreate();
 
-    QTRY_VERIFY(object->property("threw").toBool() == true);
+    QTRY_VERIFY(object->property("threw").toBool());
 }
 
 // Test that the state value properties on the XMLHttpRequest constructor have the correct values.
@@ -263,7 +263,7 @@ void tst_qqmlxmlhttprequest::open()
     QCOMPARE(object->property("responseText").toBool(), true);
     QCOMPARE(object->property("responseXML").toBool(), true);
 
-    QTRY_VERIFY(object->property("dataOK").toBool() == true);
+    QTRY_VERIFY(object->property("dataOK").toBool());
 }
 
 void tst_qqmlxmlhttprequest::open_data()
@@ -376,7 +376,7 @@ void tst_qqmlxmlhttprequest::setRequestHeader()
     object->setProperty("url", server.urlString("/testdocument.html"));
     component.completeCreate();
 
-    QTRY_VERIFY(object->property("dataOK").toBool() == true);
+    QTRY_VERIFY(object->property("dataOK").toBool());
 }
 
 // Test valid setRequestHeader() calls with different header cases
@@ -394,7 +394,7 @@ void tst_qqmlxmlhttprequest::setRequestHeader_caseInsensitive()
     object->setProperty("url", server.urlString("/testdocument.html"));
     component.completeCreate();
 
-    QTRY_VERIFY(object->property("dataOK").toBool() == true);
+    QTRY_VERIFY(object->property("dataOK").toBool());
 }
 // Test setting headers before open() throws exception
 void tst_qqmlxmlhttprequest::setRequestHeader_unsent()
@@ -459,7 +459,7 @@ void tst_qqmlxmlhttprequest::setRequestHeader_illegalName()
     QCOMPARE(object->property("responseText").toBool(), true);
     QCOMPARE(object->property("responseXML").toBool(), true);
 
-    QTRY_VERIFY(object->property("dataOK").toBool() == true);
+    QTRY_VERIFY(object->property("dataOK").toBool());
 }
 
 // Test that attempting to set a header after a request is sent throws an exception
@@ -479,7 +479,7 @@ void tst_qqmlxmlhttprequest::setRequestHeader_sent()
 
     QCOMPARE(object->property("test").toBool(), true);
 
-    QTRY_VERIFY(object->property("dataOK").toBool() == true);
+    QTRY_VERIFY(object->property("dataOK").toBool());
 }
 
 // Invalid arg count throws exception
@@ -510,7 +510,7 @@ void tst_qqmlxmlhttprequest::send_alreadySent()
     QVERIFY(!object.isNull());
 
     QCOMPARE(object->property("test").toBool(), true);
-    QTRY_VERIFY(object->property("dataOK").toBool() == true);
+    QTRY_VERIFY(object->property("dataOK").toBool());
 }
 
 // Test that sends for GET, HEAD and DELETE ignore data
@@ -530,7 +530,7 @@ void tst_qqmlxmlhttprequest::send_ignoreData()
         object->setProperty("url", server.urlString("/testdocument.html"));
         component.completeCreate();
 
-        QTRY_VERIFY(object->property("dataOK").toBool() == true);
+        QTRY_VERIFY(object->property("dataOK").toBool());
     }
 
     {
@@ -547,7 +547,7 @@ void tst_qqmlxmlhttprequest::send_ignoreData()
         object->setProperty("url", server.urlString("/testdocument.html"));
         component.completeCreate();
 
-        QTRY_VERIFY(object->property("dataOK").toBool() == true);
+        QTRY_VERIFY(object->property("dataOK").toBool());
     }
 
     {
@@ -564,7 +564,7 @@ void tst_qqmlxmlhttprequest::send_ignoreData()
         object->setProperty("url", server.urlString("/testdocument.html"));
         component.completeCreate();
 
-        QTRY_VERIFY(object->property("dataOK").toBool() == true);
+        QTRY_VERIFY(object->property("dataOK").toBool());
     }
 }
 
@@ -586,7 +586,7 @@ void tst_qqmlxmlhttprequest::send_withdata()
     object->setProperty("url", server.urlString("/testdocument.html"));
     component.completeCreate();
 
-    QTRY_VERIFY(object->property("dataOK").toBool() == true);
+    QTRY_VERIFY(object->property("dataOK").toBool());
 }
 
 void tst_qqmlxmlhttprequest::send_withdata_data()
@@ -660,7 +660,7 @@ void tst_qqmlxmlhttprequest::abort_unsent()
     QCOMPARE(object->property("responseText").toBool(), true);
     QCOMPARE(object->property("responseXML").toBool(), true);
 
-    QTRY_VERIFY(object->property("dataOK").toBool() == true);
+    QTRY_VERIFY(object->property("dataOK").toBool());
 }
 
 // Test abort() cancels an open (but unsent) request
@@ -679,7 +679,7 @@ void tst_qqmlxmlhttprequest::abort_opened()
     QCOMPARE(object->property("responseText").toBool(), true);
     QCOMPARE(object->property("responseXML").toBool(), true);
 
-    QTRY_VERIFY(object->property("dataOK").toBool() == true);
+    QTRY_VERIFY(object->property("dataOK").toBool());
 }
 
 // Test abort() aborts in progress send
@@ -705,7 +705,7 @@ void tst_qqmlxmlhttprequest::abort()
     QCOMPARE(object->property("didNotSeeUnsent").toBool(), true);
     QCOMPARE(object->property("endStateUnsent").toBool(), true);
 
-    QTRY_VERIFY(object->property("dataOK").toBool() == true);
+    QTRY_VERIFY(object->property("dataOK").toBool());
 }
 
 void tst_qqmlxmlhttprequest::getResponseHeader()
@@ -730,7 +730,7 @@ void tst_qqmlxmlhttprequest::getResponseHeader()
     QCOMPARE(object->property("readyState").toBool(), true);
     QCOMPARE(object->property("openedState").toBool(), true);
 
-    QTRY_VERIFY(object->property("dataOK").toBool() == true);
+    QTRY_VERIFY(object->property("dataOK").toBool());
 
     QCOMPARE(object->property("headersReceivedState").toBool(), true);
     QCOMPARE(object->property("headersReceivedNullHeader").toBool(), true);
@@ -772,7 +772,7 @@ void tst_qqmlxmlhttprequest::getResponseHeader_args()
     QScopedPointer<QObject> object(component.create());
     QVERIFY(!object.isNull());
 
-    QTRY_VERIFY(object->property("exceptionThrown").toBool() == true);
+    QTRY_VERIFY(object->property("exceptionThrown").toBool());
 }
 
 void tst_qqmlxmlhttprequest::getAllResponseHeaders()
@@ -796,7 +796,7 @@ void tst_qqmlxmlhttprequest::getAllResponseHeaders()
     QCOMPARE(object->property("readyState").toBool(), true);
     QCOMPARE(object->property("openedState").toBool(), true);
 
-    QTRY_VERIFY(object->property("dataOK").toBool() == true);
+    QTRY_VERIFY(object->property("dataOK").toBool());
 
     QCOMPARE(object->property("headersReceivedState").toBool(), true);
     QCOMPARE(object->property("headersReceivedHeader").toBool(), true);
@@ -832,7 +832,7 @@ void tst_qqmlxmlhttprequest::getAllResponseHeaders_args()
     QScopedPointer<QObject> object(component.create());
     QVERIFY(!object.isNull());
 
-    QTRY_VERIFY(object->property("exceptionThrown").toBool() == true);
+    QTRY_VERIFY(object->property("exceptionThrown").toBool());
 }
 
 void tst_qqmlxmlhttprequest::getBinaryData()
@@ -889,7 +889,7 @@ void tst_qqmlxmlhttprequest::status()
     object->setProperty("expectedStatus", status);
     component.completeCreate();
 
-    QTRY_VERIFY(object->property("dataOK").toBool() == true);
+    QTRY_VERIFY(object->property("dataOK").toBool());
 
     QCOMPARE(object->property("unsentException").toBool(), true);
     QCOMPARE(object->property("openedException").toBool(), true);
@@ -928,7 +928,7 @@ void tst_qqmlxmlhttprequest::statusText()
     object->setProperty("expectedStatus", statusText);
     component.completeCreate();
 
-    QTRY_VERIFY(object->property("dataOK").toBool() == true);
+    QTRY_VERIFY(object->property("dataOK").toBool());
 
     QCOMPARE(object->property("unsentException").toBool(), true);
     QCOMPARE(object->property("openedException").toBool(), true);
@@ -968,7 +968,7 @@ void tst_qqmlxmlhttprequest::responseText()
     object->setProperty("expectedText", responseText);
     component.completeCreate();
 
-    QTRY_VERIFY(object->property("dataOK").toBool() == true);
+    QTRY_VERIFY(object->property("dataOK").toBool());
 
     QCOMPARE(object->property("unsent").toBool(), true);
     QCOMPARE(object->property("opened").toBool(), true);
@@ -1004,7 +1004,7 @@ void tst_qqmlxmlhttprequest::nonUtf8()
     object->setProperty("fileName", fileName);
     QMetaObject::invokeMethod(object.data(), "startRequest");
 
-    QTRY_VERIFY(object->property("dataOK").toBool() == true);
+    QTRY_VERIFY(object->property("dataOK").toBool());
 
     QCOMPARE(object->property("responseText").toString(), responseText);
 
@@ -1108,7 +1108,7 @@ void tst_qqmlxmlhttprequest::redirects()
         object->setProperty("expectedText", "");
         component.completeCreate();
 
-        QTRY_VERIFY(object->property("done").toBool() == true);
+        QTRY_VERIFY(object->property("done").toBool());
         QCOMPARE(object->property("dataOK").toBool(), true);
     }
 
@@ -1125,7 +1125,7 @@ void tst_qqmlxmlhttprequest::redirects()
         object->setProperty("expectedText", "");
         component.completeCreate();
 
-        QTRY_VERIFY(object->property("done").toBool() == true);
+        QTRY_VERIFY(object->property("done").toBool());
         QCOMPARE(object->property("dataOK").toBool(), true);
     }
 
@@ -1146,7 +1146,7 @@ void tst_qqmlxmlhttprequest::redirects()
             if (object->property("done").toBool()) break;
             QTest::qWait(50);
         }
-        QVERIFY(object->property("done").toBool() == true);
+        QVERIFY(object->property("done").toBool());
 
         QCOMPARE(object->property("dataOK").toBool(), true);
     }
@@ -1158,7 +1158,7 @@ void tst_qqmlxmlhttprequest::responseXML_invalid()
     QScopedPointer<QObject> object(component.create());
     QVERIFY(!object.isNull());
 
-    QTRY_VERIFY(object->property("dataOK").toBool() == true);
+    QTRY_VERIFY(object->property("dataOK").toBool());
 
     QCOMPARE(object->property("xmlNull").toBool(), true);
 }
@@ -1170,7 +1170,7 @@ void tst_qqmlxmlhttprequest::document()
     QScopedPointer<QObject> object(component.create());
     QVERIFY(!object.isNull());
 
-    QTRY_VERIFY(object->property("dataOK").toBool() == true);
+    QTRY_VERIFY(object->property("dataOK").toBool());
 
     QCOMPARE(object->property("xmlTest").toBool(), true);
 }
@@ -1182,7 +1182,7 @@ void tst_qqmlxmlhttprequest::element()
     QScopedPointer<QObject> object(component.create());
     QVERIFY(!object.isNull());
 
-    QTRY_VERIFY(object->property("dataOK").toBool() == true);
+    QTRY_VERIFY(object->property("dataOK").toBool());
 
     QCOMPARE(object->property("xmlTest").toBool(), true);
 }
@@ -1194,7 +1194,7 @@ void tst_qqmlxmlhttprequest::attr()
     QScopedPointer<QObject> object(component.create());
     QVERIFY(!object.isNull());
 
-    QTRY_VERIFY(object->property("dataOK").toBool() == true);
+    QTRY_VERIFY(object->property("dataOK").toBool());
 
     QCOMPARE(object->property("xmlTest").toBool(), true);
 }
@@ -1206,7 +1206,7 @@ void tst_qqmlxmlhttprequest::text()
     QScopedPointer<QObject> object(component.create());
     QVERIFY(!object.isNull());
 
-    QTRY_VERIFY(object->property("dataOK").toBool() == true);
+    QTRY_VERIFY(object->property("dataOK").toBool());
 
     QCOMPARE(object->property("xmlTest").toBool(), true);
     QCOMPARE(object->property("status").toInt(), 200);
@@ -1219,7 +1219,7 @@ void tst_qqmlxmlhttprequest::cdata()
     QScopedPointer<QObject> object(component.create());
     QVERIFY(!object.isNull());
 
-    QTRY_VERIFY(object->property("dataOK").toBool() == true);
+    QTRY_VERIFY(object->property("dataOK").toBool());
 
     QCOMPARE(object->property("xmlTest").toBool(), true);
     QCOMPARE(object->property("status").toInt(), 200);
@@ -1244,7 +1244,7 @@ void tst_qqmlxmlhttprequest::stateChangeCallingContext()
     object->setProperty("serverBaseUrl", server.baseUrl().toString());
     component.completeCreate();
     server.sendDelayedItem();
-    QTRY_VERIFY(object->property("success").toBool() == true);
+    QTRY_VERIFY(object->property("success").toBool());
 }
 
 QTEST_MAIN(tst_qqmlxmlhttprequest)
index 45cfe4f334209d085d4454c869882a0297f676f0..4aa8580f029bf86df5715d55bac56a01b211caa7 100644 (file)
@@ -568,7 +568,7 @@ void tst_qquickanimations::alwaysRunToEnd()
     animation.setLoops(-1);
     animation.setAlwaysRunToEnd(true);
     QVERIFY(animation.loops() == -1);
-    QVERIFY(animation.alwaysRunToEnd() == true);
+    QVERIFY(animation.alwaysRunToEnd());
 
     QElapsedTimer timer;
     timer.start();
@@ -1065,7 +1065,7 @@ void tst_qquickanimations::propertyValueSourceDefaultStart()
 
         QQuickAbstractAnimation *myAnim = rect->findChild<QQuickAbstractAnimation*>("MyAnim");
         QVERIFY(myAnim);
-        QVERIFY(myAnim->isRunning() == false);
+        QVERIFY(!myAnim->isRunning());
     }
 
     {
@@ -1351,7 +1351,7 @@ void tst_qquickanimations::alwaysRunToEndRestartBug()
     animation.setLoops(-1);
     animation.setAlwaysRunToEnd(true);
     QVERIFY(animation.loops() == -1);
-    QVERIFY(animation.alwaysRunToEnd() == true);
+    QVERIFY(animation.alwaysRunToEnd());
     animation.start();
     animation.stop();
     animation.start();
index d6c1fd6eeaaf0084cd3799c5fb33749594d8e3db..30d414465472f20b3ced83c447f948a24fc55d65 100644 (file)
@@ -196,9 +196,9 @@ void tst_qquickflickable::properties()
     QCOMPARE(obj->pressDelay(), 200);
     QCOMPARE(obj->maximumFlickVelocity(), 2000.);
 
-    QVERIFY(obj->property("ok").toBool() == false);
+    QVERIFY(!obj->property("ok").toBool());
     QMetaObject::invokeMethod(obj, "check");
-    QVERIFY(obj->property("ok").toBool() == true);
+    QVERIFY(obj->property("ok").toBool());
 
     delete obj;
 }
@@ -410,10 +410,10 @@ void tst_qquickflickable::pressDelay()
     moveAndPress(window.data(), QPoint(150, 150));
 
     // The press should not occur immediately
-    QVERIFY(mouseArea->property("pressed").toBool() == false);
+    QVERIFY(!mouseArea->property("pressed").toBool());
 
     // But, it should occur eventually
-    QTRY_VERIFY(mouseArea->property("pressed").toBool() == true);
+    QTRY_VERIFY(mouseArea->property("pressed").toBool());
 
     QCOMPARE(clickedSpy.count(),0);
 
@@ -431,7 +431,7 @@ void tst_qquickflickable::pressDelay()
     moveAndPress(window.data(), QPoint(180, 180));
 
     // The press should not occur immediately
-    QVERIFY(mouseArea->property("pressed").toBool() == false);
+    QVERIFY(!mouseArea->property("pressed").toBool());
 
     QCOMPARE(clickedSpy.count(),0);
 
@@ -448,13 +448,13 @@ void tst_qquickflickable::pressDelay()
     moveAndPress(window.data(), QPoint(150, 110));
 
     // The press should not occur immediately
-    QVERIFY(mouseArea->property("pressed").toBool() == false);
+    QVERIFY(!mouseArea->property("pressed").toBool());
 
     QTest::mouseMove(window.data(), QPoint(150, 190));
 
     // As we moved pass the drag threshold, we should never receive the press
-    QVERIFY(mouseArea->property("pressed").toBool() == false);
-    QTRY_VERIFY(mouseArea->property("pressed").toBool() == false);
+    QVERIFY(!mouseArea->property("pressed").toBool());
+    QTRY_VERIFY(!mouseArea->property("pressed").toBool());
 
     // On release the clicked signal should *not* be emitted
     QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(150, 190));
@@ -481,42 +481,42 @@ void tst_qquickflickable::nestedPressDelay()
 
     moveAndPress(window.data(), QPoint(150, 150));
     // the MouseArea is not pressed immediately
-    QVERIFY(outer->property("pressed").toBool() == false);
-    QVERIFY(inner->property("pressed").toBool() == false);
+    QVERIFY(!outer->property("pressed").toBool());
+    QVERIFY(!inner->property("pressed").toBool());
 
     // The inner pressDelay will prevail (50ms, vs. 10sec)
     // QTRY_VERIFY() has 5sec timeout, so will timeout well within 10sec.
-    QTRY_VERIFY(outer->property("pressed").toBool() == true);
+    QTRY_VERIFY(outer->property("pressed").toBool());
 
     QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(150, 150));
 
     // Dragging inner Flickable should work
     moveAndPress(window.data(), QPoint(80, 150));
     // the MouseArea is not pressed immediately
-    QVERIFY(outer->property("pressed").toBool() == false);
-    QVERIFY(inner->property("pressed").toBool() == false);
+    QVERIFY(!outer->property("pressed").toBool());
+    QVERIFY(!inner->property("pressed").toBool());
 
     QTest::mouseMove(window.data(), QPoint(60, 150));
     QTest::mouseMove(window.data(), QPoint(40, 150));
     QTest::mouseMove(window.data(), QPoint(20, 150));
 
-    QVERIFY(inner->property("moving").toBool() == true);
-    QVERIFY(outer->property("moving").toBool() == false);
+    QVERIFY(inner->property("moving").toBool());
+    QVERIFY(!outer->property("moving").toBool());
 
     QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(20, 150));
 
     // Dragging the MouseArea in the inner Flickable should move the inner Flickable
     moveAndPress(window.data(), QPoint(150, 150));
     // the MouseArea is not pressed immediately
-    QVERIFY(outer->property("pressed").toBool() == false);
+    QVERIFY(!outer->property("pressed").toBool());
 
     QTest::mouseMove(window.data(), QPoint(130, 150));
     QTest::mouseMove(window.data(), QPoint(110, 150));
     QTest::mouseMove(window.data(), QPoint(90, 150));
 
 
-    QVERIFY(outer->property("moving").toBool() == false);
-    QVERIFY(inner->property("moving").toBool() == true);
+    QVERIFY(!outer->property("moving").toBool());
+    QVERIFY(inner->property("moving").toBool());
 
     QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(90, 150));
 }
@@ -542,26 +542,26 @@ void tst_qquickflickable::nestedClickThenFlick()
     moveAndPress(window.data(), QPoint(150, 150));
 
     // the MouseArea is not pressed immediately
-    QVERIFY(outer->property("pressed").toBool() == false);
-    QTRY_VERIFY(outer->property("pressed").toBool() == true);
+    QVERIFY(!outer->property("pressed").toBool());
+    QTRY_VERIFY(outer->property("pressed").toBool());
 
     QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(150, 150));
 
-    QVERIFY(outer->property("pressed").toBool() == false);
+    QVERIFY(!outer->property("pressed").toBool());
 
     // Dragging inner Flickable should work
     moveAndPress(window.data(), QPoint(80, 150));
     // the MouseArea is not pressed immediately
 
-    QVERIFY(outer->property("pressed").toBool() == false);
+    QVERIFY(!outer->property("pressed").toBool());
 
     QTest::mouseMove(window.data(), QPoint(80, 148));
     QTest::mouseMove(window.data(), QPoint(80, 140));
     QTest::mouseMove(window.data(), QPoint(80, 120));
     QTest::mouseMove(window.data(), QPoint(80, 100));
 
-    QVERIFY(outer->property("moving").toBool() == false);
-    QVERIFY(inner->property("moving").toBool() == true);
+    QVERIFY(!outer->property("moving").toBool());
+    QVERIFY(inner->property("moving").toBool());
 
     QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(80, 100));
 }
@@ -965,7 +965,7 @@ void tst_qquickflickable::movingAndDragging()
     // Don't test whether moving finished because a flick could occur
 
     // wait for any motion to end
-    QTRY_VERIFY(flickable->isMoving() == false);
+    QTRY_VERIFY(!flickable->isMoving());
 
     QVERIFY(!flickable->isMovingHorizontally());
     QVERIFY(!flickable->isMovingVertically());
@@ -1095,7 +1095,7 @@ void tst_qquickflickable::flickOnRelease()
     QCOMPARE(vFlickSpy.count(), 1);
 
     // wait for any motion to end
-    QTRY_VERIFY(flickable->isMoving() == false);
+    QTRY_VERIFY(!flickable->isMoving());
 
 #ifdef Q_OS_MAC
     QEXPECT_FAIL("", "QTBUG-26094 stopping on a full pixel doesn't work on OS X", Continue);
@@ -1174,7 +1174,7 @@ void tst_qquickflickable::disabled()
     QTest::mouseMove(window.data(), QPoint(50, 70));
     QTest::mouseMove(window.data(), QPoint(50, 60));
 
-    QVERIFY(flick->isMoving() == false);
+    QVERIFY(!flick->isMoving());
 
     QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(50, 60));
 
@@ -1182,7 +1182,7 @@ void tst_qquickflickable::disabled()
     moveAndPress(window.data(), QPoint(50, 10));
     QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(50, 10));
 
-    QTRY_VERIFY(window->rootObject()->property("clicked").toBool() == true);
+    QTRY_VERIFY(window->rootObject()->property("clicked").toBool());
 }
 
 void tst_qquickflickable::flickVelocity()
index 98f85af92e4da0ab737da1490fca83298154ba41..76e33dae114a6e272dffd01f9c0198d254755c41 100644 (file)
@@ -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;
 }
index b8ad1948edd598a597105ab899255b791d69f118..b4b44a4e58505211ada5b86b2883f7c71bd7bda9 100644 (file)
@@ -1876,7 +1876,7 @@ void tst_QQuickGridView::currentIndex()
 
     // turn off auto highlight
     gridview->setHighlightFollowsCurrentItem(false);
-    QVERIFY(gridview->highlightFollowsCurrentItem() == false);
+    QVERIFY(!gridview->highlightFollowsCurrentItem());
     QVERIFY(gridview->highlightItem());
     qreal hlPosX = gridview->highlightItem()->x();
     qreal hlPosY = gridview->highlightItem()->y();
index 91ef921141d01b66daa78362cc6ee37aa45242e5..337bb6606b5176b3b4a999d48b31144d9a67a514 100644 (file)
@@ -201,14 +201,14 @@ void tst_qquickimage::imageSource()
     QVERIFY(obj != 0);
 
     if (async)
-        QVERIFY(obj->asynchronous() == true);
+        QVERIFY(obj->asynchronous());
     else
-        QVERIFY(obj->asynchronous() == false);
+        QVERIFY(!obj->asynchronous());
 
     if (cache)
-        QVERIFY(obj->cache() == true);
+        QVERIFY(obj->cache());
     else
-        QVERIFY(obj->cache() == false);
+        QVERIFY(!obj->cache());
 
     if (remote || async)
         QTRY_VERIFY(obj->status() == QQuickImage::Loading);
index 69c72501347352458520d7f8f01f2a0877eabe76..a083b8e70dc2dfac6684e078303ee1fb229d1e49 100644 (file)
@@ -2041,7 +2041,7 @@ void tst_QQuickItem::smooth()
     QCOMPARE(spy.count(),1);
     QList<QVariant> arguments = spy.first();
     QVERIFY(arguments.count() == 1);
-    QVERIFY(arguments.at(0).toBool() == true);
+    QVERIFY(arguments.at(0).toBool());
 
     item->setSmooth(true);
     QCOMPARE(spy.count(),1);
@@ -2070,7 +2070,7 @@ void tst_QQuickItem::antialiasing()
     QCOMPARE(spy.count(),1);
     QList<QVariant> arguments = spy.first();
     QVERIFY(arguments.count() == 1);
-    QVERIFY(arguments.at(0).toBool() == true);
+    QVERIFY(arguments.at(0).toBool());
 
     item->setAntialiasing(true);
     QCOMPARE(spy.count(),1);
@@ -2099,7 +2099,7 @@ void tst_QQuickItem::clip()
 
     QList<QVariant> arguments = spy.first();
     QVERIFY(arguments.count() == 1);
-    QVERIFY(arguments.at(0).toBool() == true);
+    QVERIFY(arguments.at(0).toBool());
 
     QCOMPARE(spy.count(),1);
     item->setClip(true);
index 0c0e9115c529ec69558dca206021096aa67fc362..cb5f2e8e6cd4f5ecc36b116ba4064ead6ec97cd8 100644 (file)
@@ -396,7 +396,7 @@ void tst_QQuickListView::items(const QUrl &source)
     QTRY_VERIFY(contentItem != 0);
 
     QMetaObject::invokeMethod(window->rootObject(), "checkProperties");
-    QTRY_VERIFY(testObject->error() == false);
+    QTRY_VERIFY(!testObject->error());
 
     QTRY_VERIFY(listview->highlightItem() != 0);
     QTRY_COMPARE(listview->count(), model.count());
@@ -419,20 +419,20 @@ void tst_QQuickListView::items(const QUrl &source)
     // switch to other delegate
     testObject->setAnimate(true);
     QMetaObject::invokeMethod(window->rootObject(), "checkProperties");
-    QTRY_VERIFY(testObject->error() == false);
+    QTRY_VERIFY(!testObject->error());
     QTRY_VERIFY(listview->currentItem());
 
     // set invalid highlight
     testObject->setInvalidHighlight(true);
     QMetaObject::invokeMethod(window->rootObject(), "checkProperties");
-    QTRY_VERIFY(testObject->error() == false);
+    QTRY_VERIFY(!testObject->error());
     QTRY_VERIFY(listview->currentItem());
     QTRY_VERIFY(listview->highlightItem() == 0);
 
     // back to normal highlight
     testObject->setInvalidHighlight(false);
     QMetaObject::invokeMethod(window->rootObject(), "checkProperties");
-    QTRY_VERIFY(testObject->error() == false);
+    QTRY_VERIFY(!testObject->error());
     QTRY_VERIFY(listview->currentItem());
     QTRY_VERIFY(listview->highlightItem() != 0);
 
@@ -2266,7 +2266,7 @@ void tst_QQuickListView::sectionsDelegate_headerVisibility()
     listview->setCurrentIndex(20);
     QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false);
     QTRY_VERIFY(qFuzzyCompare(listview->contentY(), 200.0));
-    QTRY_VERIFY(listview->isMoving() == false);
+    QTRY_VERIFY(!listview->isMoving());
     listview->setCurrentIndex(0);
     QTRY_VERIFY(qFuzzyIsNull(listview->contentY()));
 
@@ -2709,7 +2709,7 @@ void tst_QQuickListView::currentIndex()
 
     // turn off auto highlight
     listview->setHighlightFollowsCurrentItem(false);
-    QVERIFY(listview->highlightFollowsCurrentItem() == false);
+    QVERIFY(!listview->highlightFollowsCurrentItem());
 
     QVERIFY(listview->highlightItem());
     qreal hlPos = listview->highlightItem()->y();
@@ -5039,7 +5039,7 @@ void tst_QQuickListView::marginsResize()
 
     // flick past the end and check content pos still settles on correct extents
     flick(window, flickStart, flickEnd, 180);
-    QTRY_VERIFY(listview->isMoving() == false);
+    QTRY_VERIFY(!listview->isMoving());
     if (orientation == QQuickListView::Vertical)
         QTRY_COMPARE(listview->contentY(), end);
     else
@@ -5054,7 +5054,7 @@ void tst_QQuickListView::marginsResize()
 
     // flick past the beginning and check content pos still settles on correct extents
     flick(window, flickEnd, flickStart, 180);
-    QTRY_VERIFY(listview->isMoving() == false);
+    QTRY_VERIFY(!listview->isMoving());
     if (orientation == QQuickListView::Vertical)
         QTRY_COMPARE(listview->contentY(), start);
     else
@@ -7892,7 +7892,7 @@ void tst_QQuickListView::QTBUG_38209()
 
     // simulate mouse flick
     flick(window.data(), QPoint(200, 200), QPoint(200, 50), 100);
-    QTRY_VERIFY(listview->isMoving() == false);
+    QTRY_VERIFY(!listview->isMoving());
     qreal contentY = listview->contentY();
 
     // flick down
index 5636b312af8b2cff589b83a1f1c0c0a56029fcde..c0e241fec810b14b31ffbec8f74cafa897547a84 100644 (file)
@@ -801,7 +801,7 @@ void tst_QQuickPathView::dataModel()
     QVERIFY(pathview != 0);
 
     QMetaObject::invokeMethod(window->rootObject(), "checkProperties");
-    QVERIFY(testObject->error() == false);
+    QVERIFY(!testObject->error());
 
     QQuickItem *item = findItem<QQuickItem>(pathview, "wrapper", 0);
     QVERIFY(item);
@@ -830,7 +830,7 @@ void tst_QQuickPathView::dataModel()
 
     testObject->setPathItemCount(5);
     QMetaObject::invokeMethod(window->rootObject(), "checkProperties");
-    QVERIFY(testObject->error() == false);
+    QVERIFY(!testObject->error());
 
     QTRY_COMPARE(findItems<QQuickItem>(pathview, "wrapper").count(), 5);
 
index c68f58383bdb0c58d96b8bfbffaacd2d88a850bc..474fdf9f8d1048a875c61a53fa090c3937cc01e5 100644 (file)
@@ -3919,9 +3919,9 @@ void tst_qquickpositioners::test_attachedproperties()
     int posIndex = greenRect->property("posIndex").toInt();
     QVERIFY(posIndex == 0);
     bool isFirst = greenRect->property("isFirstItem").toBool();
-    QVERIFY(isFirst == true);
+    QVERIFY(isFirst);
     bool isLast = greenRect->property("isLastItem").toBool();
-    QVERIFY(isLast == false);
+    QVERIFY(!isLast);
 
     QQuickRectangle *yellowRect = window->rootObject()->findChild<QQuickRectangle *>("yellowRect");
     QVERIFY(yellowRect != 0);
@@ -3929,18 +3929,18 @@ void tst_qquickpositioners::test_attachedproperties()
     posIndex = yellowRect->property("posIndex").toInt();
     QVERIFY(posIndex == -1);
     isFirst = yellowRect->property("isFirstItem").toBool();
-    QVERIFY(isFirst == false);
+    QVERIFY(!isFirst);
     isLast = yellowRect->property("isLastItem").toBool();
-    QVERIFY(isLast == false);
+    QVERIFY(!isLast);
 
     yellowRect->metaObject()->invokeMethod(yellowRect, "onDemandPositioner");
 
     posIndex = yellowRect->property("posIndex").toInt();
     QVERIFY(posIndex == 1);
     isFirst = yellowRect->property("isFirstItem").toBool();
-    QVERIFY(isFirst == false);
+    QVERIFY(!isFirst);
     isLast = yellowRect->property("isLastItem").toBool();
-    QVERIFY(isLast == true);
+    QVERIFY(isLast);
 
 }
 
@@ -3968,9 +3968,9 @@ void tst_qquickpositioners::test_attachedproperties_dynamic()
     int posIndex = rect0->property("index").toInt();
     QVERIFY(posIndex == 0);
     bool isFirst = rect0->property("firstItem").toBool();
-    QVERIFY(isFirst == true);
+    QVERIFY(isFirst);
     bool isLast = rect0->property("lastItem").toBool();
-    QVERIFY(isLast == false);
+    QVERIFY(!isLast);
 
     QQuickRectangle *rect1 = window->rootObject()->findChild<QQuickRectangle *>("rect1");
     QVERIFY(rect1 != 0);
@@ -3978,15 +3978,15 @@ void tst_qquickpositioners::test_attachedproperties_dynamic()
     posIndex = rect1->property("index").toInt();
     QVERIFY(posIndex == 1);
     isFirst = rect1->property("firstItem").toBool();
-    QVERIFY(isFirst == false);
+    QVERIFY(!isFirst);
     isLast = rect1->property("lastItem").toBool();
-    QVERIFY(isLast == true);
+    QVERIFY(isLast);
 
     row->metaObject()->invokeMethod(row, "createSubRect");
 
     QTRY_VERIFY(rect1->property("index").toInt() == 1);
-    QTRY_VERIFY(rect1->property("firstItem").toBool() == false);
-    QTRY_VERIFY(rect1->property("lastItem").toBool() == false);
+    QTRY_VERIFY(!rect1->property("firstItem").toBool());
+    QTRY_VERIFY(!rect1->property("lastItem").toBool());
 
     QQuickRectangle *rect2 = window->rootObject()->findChild<QQuickRectangle *>("rect2");
     QVERIFY(rect2 != 0);
@@ -3994,9 +3994,9 @@ void tst_qquickpositioners::test_attachedproperties_dynamic()
     posIndex = rect2->property("index").toInt();
     QVERIFY(posIndex == 2);
     isFirst = rect2->property("firstItem").toBool();
-    QVERIFY(isFirst == false);
+    QVERIFY(!isFirst);
     isLast = rect2->property("lastItem").toBool();
-    QVERIFY(isLast == true);
+    QVERIFY(isLast);
 
     row->metaObject()->invokeMethod(row, "destroySubRect");
 
@@ -4004,8 +4004,8 @@ void tst_qquickpositioners::test_attachedproperties_dynamic()
     QCoreApplication::processEvents();
 
     QTRY_VERIFY(rect1->property("index").toInt() == 1);
-    QTRY_VERIFY(rect1->property("firstItem").toBool() == false);
-    QTRY_VERIFY(rect1->property("lastItem").toBool() == true);
+    QTRY_VERIFY(!rect1->property("firstItem").toBool());
+    QTRY_VERIFY(rect1->property("lastItem").toBool());
 
 }
 
index 559f816a9bd76e16cfe696c77ce66e3da5a39e29..ab03bbcdce71203f6a60a3d8fe0ea287228d9595 100644 (file)
@@ -132,7 +132,7 @@ void tst_QQuickRepeater::numberModel()
     QVERIFY(!repeater->itemAt(repeater->count()));
 
     QMetaObject::invokeMethod(window->rootObject(), "checkProperties");
-    QVERIFY(testObject->error() == false);
+    QVERIFY(!testObject->error());
 
     delete testObject;
     delete window;
@@ -444,7 +444,7 @@ void tst_QQuickRepeater::itemModel()
 
     testObject->setUseModel(true);
     QMetaObject::invokeMethod(window->rootObject(), "checkProperties");
-    QVERIFY(testObject->error() == false);
+    QVERIFY(!testObject->error());
 
     QCOMPARE(container->childItems().count(), 4);
     QVERIFY(qobject_cast<QObject*>(container->childItems().at(0))->objectName() == "item1");
index c1d454e5df1c52ee1b7bfa681b36212226f792c2..a04f5e60af61f538ca32ba3d95923a04933ce858 100644 (file)
@@ -663,7 +663,7 @@ void tst_qquicktext::textFormat()
 
         QQuickTextPrivate *textPrivate = QQuickTextPrivate::get(textObject);
         QVERIFY(textPrivate != 0);
-        QVERIFY(textPrivate->richText == true);
+        QVERIFY(textPrivate->richText);
 
         delete textObject;
     }
@@ -677,7 +677,7 @@ void tst_qquicktext::textFormat()
 
         QQuickTextPrivate *textPrivate = QQuickTextPrivate::get(textObject);
         QVERIFY(textPrivate != 0);
-        QVERIFY(textPrivate->styledText == true);
+        QVERIFY(textPrivate->styledText);
 
         delete textObject;
     }
index e5c4d0aba5ed31f4e6f4fbc26b653db1bd4d7d5c..5a9ce2f6d736e3617d6d5b66b10138ff7a771e8f 100644 (file)
@@ -1539,31 +1539,31 @@ void tst_qquicktextedit::keySelection()
     QSignalSpy spy(input, SIGNAL(selectedTextChanged()));
 
     simulateKey(&window, Qt::Key_Right, Qt::ShiftModifier);
-    QVERIFY(input->hasActiveFocus() == true);
+    QVERIFY(input->hasActiveFocus());
     QCOMPARE(input->selectedText(), QString("a"));
     QCOMPARE(spy.count(), 1);
     simulateKey(&window, Qt::Key_Right);
-    QVERIFY(input->hasActiveFocus() == true);
+    QVERIFY(input->hasActiveFocus());
     QCOMPARE(input->selectedText(), QString());
     QCOMPARE(spy.count(), 2);
     simulateKey(&window, Qt::Key_Right);
-    QVERIFY(input->hasActiveFocus() == false);
+    QVERIFY(!input->hasActiveFocus());
     QCOMPARE(input->selectedText(), QString());
     QCOMPARE(spy.count(), 2);
 
     simulateKey(&window, Qt::Key_Left);
-    QVERIFY(input->hasActiveFocus() == true);
+    QVERIFY(input->hasActiveFocus());
     QCOMPARE(spy.count(), 2);
     simulateKey(&window, Qt::Key_Left, Qt::ShiftModifier);
-    QVERIFY(input->hasActiveFocus() == true);
+    QVERIFY(input->hasActiveFocus());
     QCOMPARE(input->selectedText(), QString("a"));
     QCOMPARE(spy.count(), 3);
     simulateKey(&window, Qt::Key_Left);
-    QVERIFY(input->hasActiveFocus() == true);
+    QVERIFY(input->hasActiveFocus());
     QCOMPARE(input->selectedText(), QString());
     QCOMPARE(spy.count(), 4);
     simulateKey(&window, Qt::Key_Left);
-    QVERIFY(input->hasActiveFocus() == false);
+    QVERIFY(!input->hasActiveFocus());
     QCOMPARE(input->selectedText(), QString());
     QCOMPARE(spy.count(), 4);
 }
@@ -2790,17 +2790,17 @@ void tst_qquicktextedit::navigation()
     QQuickTextEdit *input = qobject_cast<QQuickTextEdit *>(qvariant_cast<QObject *>(window.rootObject()->property("myInput")));
 
     QVERIFY(input != 0);
-    QTRY_VERIFY(input->hasActiveFocus() == true);
+    QTRY_VERIFY(input->hasActiveFocus());
     simulateKey(&window, Qt::Key_Left);
-    QVERIFY(input->hasActiveFocus() == false);
+    QVERIFY(!input->hasActiveFocus());
     simulateKey(&window, Qt::Key_Right);
-    QVERIFY(input->hasActiveFocus() == true);
+    QVERIFY(input->hasActiveFocus());
     simulateKey(&window, Qt::Key_Right);
-    QVERIFY(input->hasActiveFocus() == true);
+    QVERIFY(input->hasActiveFocus());
     simulateKey(&window, Qt::Key_Right);
-    QVERIFY(input->hasActiveFocus() == false);
+    QVERIFY(!input->hasActiveFocus());
     simulateKey(&window, Qt::Key_Left);
-    QVERIFY(input->hasActiveFocus() == true);
+    QVERIFY(input->hasActiveFocus());
 
     // Test left and right navigation works if the TextEdit is empty (QTBUG-25447).
     input->setText(QString());
@@ -2980,8 +2980,8 @@ void tst_qquicktextedit::readOnly()
     QQuickTextEdit *edit = qobject_cast<QQuickTextEdit *>(qvariant_cast<QObject *>(window.rootObject()->property("myInput")));
 
     QVERIFY(edit != 0);
-    QTRY_VERIFY(edit->hasActiveFocus() == true);
-    QVERIFY(edit->isReadOnly() == true);
+    QTRY_VERIFY(edit->hasActiveFocus());
+    QVERIFY(edit->isReadOnly());
     QString initial = edit->text();
     for (int k=Qt::Key_0; k<=Qt::Key_Z; k++)
         simulateKey(&window, k);
@@ -3013,7 +3013,7 @@ void tst_qquicktextedit::textInput()
     QTest::qWaitForWindowActive(&view);
     QQuickTextEdit *edit = qobject_cast<QQuickTextEdit *>(view.rootObject());
     QVERIFY(edit);
-    QVERIFY(edit->hasActiveFocus() == true);
+    QVERIFY(edit->hasActiveFocus());
 
     // test that input method event is committed and change signal is emitted
     QSignalSpy spy(edit, SIGNAL(textChanged()));
@@ -3049,7 +3049,7 @@ void tst_qquicktextedit::inputMethodUpdate()
     QTest::qWaitForWindowActive(&view);
     QQuickTextEdit *edit = qobject_cast<QQuickTextEdit *>(view.rootObject());
     QVERIFY(edit);
-    QVERIFY(edit->hasActiveFocus() == true);
+    QVERIFY(edit->hasActiveFocus());
 
     // text change even without cursor position change needs to trigger update
     edit->setText("test");
index 9ded3870c780017207a568d078b8c03fbc51c8ff..3e4d2c658e6458697f5b2bf627cb49c7030a02d3 100644 (file)
@@ -1863,7 +1863,7 @@ void tst_qquicktextinput::maxLength()
     }
 
     textinputObject->setText("");
-    QTRY_VERIFY(textinputObject->hasActiveFocus() == true);
+    QTRY_VERIFY(textinputObject->hasActiveFocus());
     for (int i=0; i<20; i++) {
         QTRY_COMPARE(textinputObject->text().length(), qMin(i,10));
         //simulateKey(&window, Qt::Key_A);
@@ -1882,7 +1882,7 @@ void tst_qquicktextinput::masks()
     QVERIFY(window.rootObject() != 0);
     QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput *>(window.rootObject());
     QVERIFY(textinputObject != 0);
-    QTRY_VERIFY(textinputObject->hasActiveFocus() == true);
+    QTRY_VERIFY(textinputObject->hasActiveFocus());
     QVERIFY(textinputObject->text().length() == 0);
     QCOMPARE(textinputObject->inputMask(), QString("HHHHhhhh; "));
     QCOMPARE(textinputObject->length(), 8);
@@ -1999,7 +1999,7 @@ void tst_qquicktextinput::validators()
     QCOMPARE(dblInput->validator()->locale(), defaultLocale);
 
     dblInput->setFocus(true);
-    QVERIFY(dblInput->hasActiveFocus() == true);
+    QVERIFY(dblInput->hasActiveFocus());
     QCOMPARE(dblInput->hasAcceptableInput(), false);
     QCOMPARE(dblInput->property("acceptable").toBool(), false);
     QTest::keyPress(&window, Qt::Key_1);
@@ -2133,7 +2133,7 @@ void tst_qquicktextinput::validators()
     QVERIFY(strInput);
     QSignalSpy strSpy(strInput, SIGNAL(acceptableInputChanged()));
     strInput->setFocus(true);
-    QVERIFY(strInput->hasActiveFocus() == true);
+    QVERIFY(strInput->hasActiveFocus());
     QCOMPARE(strInput->hasAcceptableInput(), false);
     QCOMPARE(strInput->property("acceptable").toBool(), false);
     QTest::keyPress(&window, Qt::Key_1);
@@ -2177,7 +2177,7 @@ void tst_qquicktextinput::validators()
     QVERIFY(unvalidatedInput);
     QSignalSpy unvalidatedSpy(unvalidatedInput, SIGNAL(acceptableInputChanged()));
     unvalidatedInput->setFocus(true);
-    QVERIFY(unvalidatedInput->hasActiveFocus() == true);
+    QVERIFY(unvalidatedInput->hasActiveFocus());
     QCOMPARE(unvalidatedInput->hasAcceptableInput(), true);
     QCOMPARE(unvalidatedInput->property("acceptable").toBool(), true);
     QTest::keyPress(&window, Qt::Key_1);
@@ -2218,7 +2218,7 @@ void tst_qquicktextinput::inputMethods()
     QCOMPARE(plainInput.inputMethodHints(), Qt::ImhNone);
 
     input->setFocus(true);
-    QVERIFY(input->hasActiveFocus() == true);
+    QVERIFY(input->hasActiveFocus());
     // test that input method event is committed
     QInputMethodEvent event;
     event.setCommitString( "My ", -12, 0);
@@ -2401,11 +2401,11 @@ void tst_qquicktextinput::navigation()
 
     QVERIFY(input != 0);
     input->setCursorPosition(0);
-    QTRY_VERIFY(input->hasActiveFocus() == true);
+    QTRY_VERIFY(input->hasActiveFocus());
     simulateKey(&window, Qt::Key_Left);
-    QVERIFY(input->hasActiveFocus() == false);
+    QVERIFY(!input->hasActiveFocus());
     simulateKey(&window, Qt::Key_Right);
-    QVERIFY(input->hasActiveFocus() == true);
+    QVERIFY(input->hasActiveFocus());
     //QT-2944: If text is selected, ensure we deselect upon cursor motion
     input->setCursorPosition(input->text().length());
     input->select(0,input->text().length());
@@ -2413,11 +2413,11 @@ void tst_qquicktextinput::navigation()
     simulateKey(&window, Qt::Key_Right);
     QVERIFY(input->selectionStart() == input->selectionEnd());
     QVERIFY(input->selectionStart() == input->text().length());
-    QVERIFY(input->hasActiveFocus() == true);
+    QVERIFY(input->hasActiveFocus());
     simulateKey(&window, Qt::Key_Right);
-    QVERIFY(input->hasActiveFocus() == false);
+    QVERIFY(!input->hasActiveFocus());
     simulateKey(&window, Qt::Key_Left);
-    QVERIFY(input->hasActiveFocus() == true);
+    QVERIFY(input->hasActiveFocus());
 
     // Up and Down should NOT do Home/End, even on Mac OS X (QTBUG-10438).
     input->setCursorPosition(2);
@@ -2453,26 +2453,26 @@ void tst_qquicktextinput::navigation_RTL()
     input->setText(QString::fromUtf16(arabic_str, 11));
 
     input->setCursorPosition(0);
-    QTRY_VERIFY(input->hasActiveFocus() == true);
+    QTRY_VERIFY(input->hasActiveFocus());
 
     // move off
     simulateKey(&window, Qt::Key_Right);
-    QVERIFY(input->hasActiveFocus() == false);
+    QVERIFY(!input->hasActiveFocus());
 
     // move back
     simulateKey(&window, Qt::Key_Left);
-    QVERIFY(input->hasActiveFocus() == true);
+    QVERIFY(input->hasActiveFocus());
 
     input->setCursorPosition(input->text().length());
-    QVERIFY(input->hasActiveFocus() == true);
+    QVERIFY(input->hasActiveFocus());
 
     // move off
     simulateKey(&window, Qt::Key_Left);
-    QVERIFY(input->hasActiveFocus() == false);
+    QVERIFY(!input->hasActiveFocus());
 
     // move back
     simulateKey(&window, Qt::Key_Right);
-    QVERIFY(input->hasActiveFocus() == true);
+    QVERIFY(input->hasActiveFocus());
 }
 
 #ifndef QT_NO_CLIPBOARD
@@ -3200,9 +3200,9 @@ void tst_qquicktextinput::readOnly()
     QQuickTextInput *input = qobject_cast<QQuickTextInput *>(qvariant_cast<QObject *>(window.rootObject()->property("myInput")));
 
     QVERIFY(input != 0);
-    QTRY_VERIFY(input->hasActiveFocus() == true);
-    QVERIFY(input->isReadOnly() == true);
-    QVERIFY(input->isCursorVisible() == false);
+    QTRY_VERIFY(input->hasActiveFocus());
+    QVERIFY(input->isReadOnly());
+    QVERIFY(!input->isCursorVisible());
     QString initial = input->text();
     for (int k=Qt::Key_0; k<=Qt::Key_Z; k++)
         simulateKey(&window, k);
@@ -3215,7 +3215,7 @@ void tst_qquicktextinput::readOnly()
     input->setReadOnly(false);
     QCOMPARE(input->isReadOnly(), false);
     QCOMPARE(input->cursorPosition(), input->text().length());
-    QVERIFY(input->isCursorVisible() == true);
+    QVERIFY(input->isCursorVisible());
 }
 
 void tst_qquicktextinput::echoMode()
@@ -3230,7 +3230,7 @@ void tst_qquicktextinput::echoMode()
     QQuickTextInput *input = qobject_cast<QQuickTextInput *>(qvariant_cast<QObject *>(window.rootObject()->property("myInput")));
 
     QVERIFY(input != 0);
-    QTRY_VERIFY(input->hasActiveFocus() == true);
+    QTRY_VERIFY(input->hasActiveFocus());
     QString initial = input->text();
     Qt::InputMethodHints ref;
     QCOMPARE(initial, QLatin1String("ABCDefgh"));
@@ -3278,7 +3278,7 @@ void tst_qquicktextinput::echoMode()
     QCOMPARE(input->displayText(), QLatin1String("a"));
     COMPARE_INPUT_METHOD_QUERY(QString, input, Qt::ImSurroundingText, toString, QLatin1String("a"));
     input->setFocus(false);
-    QVERIFY(input->hasActiveFocus() == false);
+    QVERIFY(!input->hasActiveFocus());
     QCOMPARE(input->displayText(), QLatin1String("Q"));
     COMPARE_INPUT_METHOD_QUERY(QString, input, Qt::ImSurroundingText, toString, QLatin1String("Q"));
     input->setFocus(true);
index 333c2107130153ed9dd2d9b77469b258105fbebd..51a80ea0e9fa0436713af1ae60f321f6c58db6f0 100644 (file)
@@ -1693,7 +1693,7 @@ void tst_qquickwindow::requestActivate()
     window1->requestActivate();                 // and then transfer the focus to window1
 
     QTRY_COMPARE(QGuiApplication::focusWindow(), window1.data());
-    QVERIFY(window1->isActive() == true);
+    QVERIFY(window1->isActive());
 
     QQuickItem *item = QQuickVisualTestUtil::findItem<QQuickItem>(window1->contentItem(), "item1");
     QVERIFY(item);