diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-03-13 01:01:04 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-03-13 10:10:09 +0100 |
commit | 76be4abbbcfb2fbb14ce532413e0895198e7f0f1 (patch) | |
tree | 5d6ca9c4425df15a93b6f74dc8e4dbb38db74d91 /tests/auto/qml | |
parent | 587d789fa5929f462b5744ba33a25db6c77b36fc (diff) | |
parent | 70d726e91e4ef27002b2271805de19077e25809c (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
src/qml/compiler/qv4codegen.cpp
src/qml/animations/qsequentialanimationgroupjob.cpp
Change-Id: I8b76e509fd7c8599d4cef25181d790ee28edab54
Diffstat (limited to 'tests/auto/qml')
3 files changed, 47 insertions, 3 deletions
diff --git a/tests/auto/qml/animation/qanimationgroupjob/tst_qanimationgroupjob.cpp b/tests/auto/qml/animation/qanimationgroupjob/tst_qanimationgroupjob.cpp index 974357dc8e..6bd8c2a2e0 100644 --- a/tests/auto/qml/animation/qanimationgroupjob/tst_qanimationgroupjob.cpp +++ b/tests/auto/qml/animation/qanimationgroupjob/tst_qanimationgroupjob.cpp @@ -261,15 +261,18 @@ void tst_QAnimationGroupJob::addChildTwice() { QAbstractAnimationJob *subGroup; QAbstractAnimationJob *subGroup2; - QAnimationGroupJob *parent = new QSequentialAnimationGroupJob(); + auto *parent = new QSequentialAnimationGroupJob(); subGroup = new QAbstractAnimationJob; parent->appendAnimation(subGroup); parent->appendAnimation(subGroup); - QVERIFY(parent->firstChild() && !parent->firstChild()->nextSibling()); + QVERIFY(parent->firstChild()); + QVERIFY(!parent->firstChild()->nextSibling()); + QVERIFY(!parent->firstChild()->previousSibling()); parent->clear(); + QCOMPARE(parent->currentAnimation(), nullptr); QVERIFY(!parent->firstChild()); // adding the same item twice to a group will remove the item from its current position diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index eaf60aec38..fdef1c0956 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -361,6 +361,9 @@ private slots: void importLexicalVariables(); void hugeObject(); void templateStringTerminator(); + void arrayAndException(); + void numberToStringWithRadix(); + void tailCallWithArguments(); private: // static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter); @@ -8876,6 +8879,41 @@ void tst_qqmlecmascript::templateStringTerminator() QCOMPARE(value.toString(), QLatin1String("x123\ny^")); } +void tst_qqmlecmascript::arrayAndException() +{ + QJSEngine engine; + const QJSValue value = engine.evaluate("[...[],[,,$]]"); + // Should not crash + QVERIFY(value.isError()); +} + +void tst_qqmlecmascript::numberToStringWithRadix() +{ + QJSEngine engine; + { + const QJSValue value = engine.evaluate(".5.toString(5)"); + QVERIFY(!value.isError()); + QVERIFY(value.toString().startsWith("0.2222222222")); + } + { + const QJSValue value = engine.evaluate(".05.toString(5)"); + QVERIFY(!value.isError()); + QVERIFY(value.toString().startsWith("0.01111111111")); + } +} + +void tst_qqmlecmascript::tailCallWithArguments() +{ + QJSEngine engine; + const QJSValue value = engine.evaluate( + "'use strict';\n" + "[[1, 2]].map(function (a) {\n" + " return (function() { return Math.min.apply(this, arguments); })(a[0], a[1]);\n" + "})[0];"); + QVERIFY(!value.isError()); + QCOMPARE(value.toInt(), 1); +} + QTEST_MAIN(tst_qqmlecmascript) #include "tst_qqmlecmascript.moc" diff --git a/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp b/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp index 2511eebefe..341a49bf09 100644 --- a/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp +++ b/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp @@ -109,7 +109,10 @@ void tst_qqmlextensionplugin::iidCheck() if (qobject_cast<QQmlExtensionPlugin *>(loader.instance())) { QString iid = loader.metaData().value(QStringLiteral("IID")).toString(); - QCOMPARE(iid, QLatin1String(QQmlExtensionInterface_iid)); + if (iid == QLatin1String(QQmlExtensionInterface_iid_old)) + qWarning() << "Old extension plugin found. Update the IID" << loader.metaData(); + else + QCOMPARE(iid, QLatin1String(QQmlExtensionInterface_iid)); } } |