aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-09-12 09:31:16 +0200
committerUlf Hermann <ulf.hermann@qt.io>2019-09-12 15:44:54 +0200
commite38ab72a7c2ce12b44e7772dee79cf1e00386b38 (patch)
tree75646ac2a37a611c5ce7e9781fe3bf5043a264ae /tests
parentf19ec4561b4975d68290593b599d3c38d0f9f6d3 (diff)
tst_qqmlecmascript: Cast pointer to unsigned for printing
Otherwise QString::number() will apparently extend "negative" values to 64bits even if the actual type is only 32bits long. Change-Id: Ibdecff2fe707616d2254b7e34e08247f0ff52489 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index d06243897c..df4963cb6e 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -2047,7 +2047,7 @@ void tst_qqmlecmascript::functionErrors()
QObject *resource = qobject_cast<ScarceResourceObject*>(QQmlProperty::read(object, "a").value<QObject*>());
warning = url + QLatin1String(":16: TypeError: Property 'scarceResource' of object ScarceResourceObject(0x%1) is not a function");
- warning = warning.arg(QString::number((qintptr)resource, 16));
+ warning = warning.arg(QString::number(quintptr(resource), 16));
QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData()); // we expect a meaningful warning to be printed.
QMetaObject::invokeMethod(object, "retrieveScarceResource");
delete object;
@@ -4553,7 +4553,7 @@ void tst_qqmlecmascript::scarceResources_other()
eo = qobject_cast<ScarceResourceObject*>(QQmlProperty::read(object, "a").value<QObject*>());
QVERIFY(eo->scarceResourceIsDetached()); // should be no other copies of it at this stage.
expectedWarning = varComponentTwelve.url().toString() + QLatin1String(":16: TypeError: Property 'scarceResource' of object ScarceResourceObject(0x%1) is not a function");
- expectedWarning = expectedWarning.arg(QString::number((qintptr)eo, 16));
+ expectedWarning = expectedWarning.arg(QString::number(quintptr(eo), 16));
QTest::ignoreMessage(QtWarningMsg, qPrintable(expectedWarning)); // we expect a meaningful warning to be printed.
QMetaObject::invokeMethod(object, "retrieveScarceResource");
QVERIFY(!object->property("scarceResourceCopy").isValid()); // due to exception, assignment will NOT have occurred.
@@ -4627,7 +4627,7 @@ void tst_qqmlecmascript::scarceResources_other()
eo = qobject_cast<ScarceResourceObject*>(QQmlProperty::read(object, "a").value<QObject*>());
QVERIFY(eo->scarceResourceIsDetached()); // should be no other copies of it at this stage.
expectedWarning = variantComponentTwelve.url().toString() + QLatin1String(":16: TypeError: Property 'scarceResource' of object ScarceResourceObject(0x%1) is not a function");
- expectedWarning = expectedWarning.arg(QString::number((qintptr)eo, 16));
+ expectedWarning = expectedWarning.arg(QString::number(quintptr(eo), 16));
QTest::ignoreMessage(QtWarningMsg, qPrintable(expectedWarning)); // we expect a meaningful warning to be printed.
QMetaObject::invokeMethod(object, "retrieveScarceResource");
QVERIFY(!object->property("scarceResourceCopy").isValid()); // due to exception, assignment will NOT have occurred.