aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml
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/qml
parentfb9c53eef298d943706eb1d508c7f72a57c42249 (diff)
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/qml')
-rw-r--r--tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp2
-rw-r--r--tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp2
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp36
-rw-r--r--tests/auto/qml/qqmlengine/tst_qqmlengine.cpp2
-rw-r--r--tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp142
-rw-r--r--tests/auto/qml/qqmltimer/tst_qqmltimer.cpp8
-rw-r--r--tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp64
7 files changed, 128 insertions, 128 deletions
diff --git a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
index 4c1f827915..dddd9a7dc8 100644
--- a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
+++ b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
@@ -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;
}
diff --git a/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp b/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
index 45393bf2f0..c7781c2e9d 100644
--- a/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
+++ b/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
@@ -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);
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index eb25eb70f4..78c4022322 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -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()
diff --git a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
index eac648ef15..2cefb6bf3f 100644
--- a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
+++ b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
@@ -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;
diff --git a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp
index b5963e2f71..012080a5d9 100644
--- a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp
+++ b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp
@@ -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());
}
}
diff --git a/tests/auto/qml/qqmltimer/tst_qqmltimer.cpp b/tests/auto/qml/qqmltimer/tst_qqmltimer.cpp
index 17083a4c6a..8c0f280116 100644
--- a/tests/auto/qml/qqmltimer/tst_qqmltimer.cpp
+++ b/tests/auto/qml/qqmltimer/tst_qqmltimer.cpp
@@ -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()));
diff --git a/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp b/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp
index d7f0d3bb79..22f321654c 100644
--- a/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp
+++ b/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp
@@ -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)