Fix qqmlecmascript failures for Android
Some silly ignoreMessage failures on 32 bit systems.. QString::number((quint32)0xaabbccdd, 16) returns "0xaabbccdd" while QString::number((qint32)0xaabbccdd, 16) returns "0xffffffffaabbccdd" We therefore change to use quintptr (which will follow the quint32 codepath). Change-Id: I40530d8da83ee43862541f0e87684dc11ed07a53 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
parent
982a397a52
commit
3db15da8e1
|
@ -2048,7 +2048,7 @@ void tst_qqmlecmascript::functionErrors()
|
||||||
|
|
||||||
QObject *resource = qobject_cast<ScarceResourceObject*>(QQmlProperty::read(object, "a").value<QObject*>());
|
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 = 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.
|
QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData()); // we expect a meaningful warning to be printed.
|
||||||
QMetaObject::invokeMethod(object, "retrieveScarceResource");
|
QMetaObject::invokeMethod(object, "retrieveScarceResource");
|
||||||
delete object;
|
delete object;
|
||||||
|
@ -4573,7 +4573,7 @@ void tst_qqmlecmascript::scarceResources_other()
|
||||||
eo = qobject_cast<ScarceResourceObject*>(QQmlProperty::read(object, "a").value<QObject*>());
|
eo = qobject_cast<ScarceResourceObject*>(QQmlProperty::read(object, "a").value<QObject*>());
|
||||||
QVERIFY(eo->scarceResourceIsDetached()); // should be no other copies of it at this stage.
|
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 = 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.
|
QTest::ignoreMessage(QtWarningMsg, qPrintable(expectedWarning)); // we expect a meaningful warning to be printed.
|
||||||
QMetaObject::invokeMethod(object, "retrieveScarceResource");
|
QMetaObject::invokeMethod(object, "retrieveScarceResource");
|
||||||
QVERIFY(!object->property("scarceResourceCopy").isValid()); // due to exception, assignment will NOT have occurred.
|
QVERIFY(!object->property("scarceResourceCopy").isValid()); // due to exception, assignment will NOT have occurred.
|
||||||
|
@ -4647,7 +4647,7 @@ void tst_qqmlecmascript::scarceResources_other()
|
||||||
eo = qobject_cast<ScarceResourceObject*>(QQmlProperty::read(object, "a").value<QObject*>());
|
eo = qobject_cast<ScarceResourceObject*>(QQmlProperty::read(object, "a").value<QObject*>());
|
||||||
QVERIFY(eo->scarceResourceIsDetached()); // should be no other copies of it at this stage.
|
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 = 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.
|
QTest::ignoreMessage(QtWarningMsg, qPrintable(expectedWarning)); // we expect a meaningful warning to be printed.
|
||||||
QMetaObject::invokeMethod(object, "retrieveScarceResource");
|
QMetaObject::invokeMethod(object, "retrieveScarceResource");
|
||||||
QVERIFY(!object->property("scarceResourceCopy").isValid()); // due to exception, assignment will NOT have occurred.
|
QVERIFY(!object->property("scarceResourceCopy").isValid()); // due to exception, assignment will NOT have occurred.
|
||||||
|
|
Loading…
Reference in New Issue