aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-03-16 01:00:16 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-03-18 13:49:23 +0100
commite912c646e22f845cf14f82532fb2c05628371974 (patch)
tree55f82c3f5b3d30f0d13cc0b92bacddf7f66e0baa /tests/auto
parentdc3e3090d21339d78abc706369117b3396c843af (diff)
parentf396cc753da75c68c6a501379a18df3099697f42 (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts: src/qml/compiler/qv4codegen.cpp Change-Id: I66b7db42bf208855889094ace0267326595ce03c
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp22
-rw-r--r--tests/auto/qml/qqmlparser/tst_qqmlparser.cpp5
-rw-r--r--tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp6
3 files changed, 29 insertions, 4 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index fdef1c0956..e6603a1a19 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -364,6 +364,7 @@ private slots:
void arrayAndException();
void numberToStringWithRadix();
void tailCallWithArguments();
+ void deleteSparseInIteration();
private:
// static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter);
@@ -8914,6 +8915,27 @@ void tst_qqmlecmascript::tailCallWithArguments()
QCOMPARE(value.toInt(), 1);
}
+void tst_qqmlecmascript::deleteSparseInIteration()
+{
+ QJSEngine engine;
+ const QJSValue value = engine.evaluate(
+ "(function() {\n"
+ " var obj = { 1: null, 2: null, 4096: null };\n"
+ " var iterated = [];\n"
+ " for (var t in obj) {\n"
+ " if (t == 2)\n"
+ " delete obj[t];\n"
+ " iterated.push(t);\n"
+ " }\n"
+ " return iterated;"
+ "})()");
+ QVERIFY(value.isArray());
+ QCOMPARE(value.property("length").toInt(), 3);
+ QCOMPARE(value.property("0").toInt(), 1);
+ QCOMPARE(value.property("1").toInt(), 2);
+ QCOMPARE(value.property("2").toInt(), 4096);
+}
+
QTEST_MAIN(tst_qqmlecmascript)
#include "tst_qqmlecmascript.moc"
diff --git a/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp b/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp
index c2c73935c0..71dd900073 100644
--- a/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp
+++ b/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp
@@ -105,6 +105,11 @@ public:
{
nodeStack.removeLast();
}
+
+ void throwRecursionDepthError() final
+ {
+ QFAIL("Maximum statement or expression depth exceeded");
+ }
};
}
diff --git a/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp b/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp
index f6ca999cf5..b34612ee88 100644
--- a/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp
+++ b/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp
@@ -134,14 +134,12 @@ void tst_qquickrectangle::gradient_separate()
// Start off clean
QQuickItemPrivate *rectPriv = QQuickItemPrivate::get(rect);
- bool isDirty = rectPriv->dirtyAttributes & QQuickItemPrivate::Content;
- QVERIFY(!isDirty);
+ QTRY_COMPARE(rectPriv->dirtyAttributes & QQuickItemPrivate::Content, 0);
QMetaObject::invokeMethod(rect, "changeGradient");
// Changing the gradient should have scheduled an update of the item.
- isDirty = rectPriv->dirtyAttributes & QQuickItemPrivate::Content;
- QVERIFY(isDirty);
+ QVERIFY((rectPriv->dirtyAttributes & QQuickItemPrivate::Content) != 0);
}
// When a gradient is changed, every Rectangle connected to it must update.