From: Lars Knoll Date: Thu, 13 Jun 2013 15:44:44 +0000 (+0200) Subject: Fix test case X-Git-Tag: upstream/5.2.1~669^2~222 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cb8273289848fd1d8ddf9d37327e5211d959595a;p=platform%2Fupstream%2Fqtdeclarative.git Fix test case The for..in statements behavior is actually undefined when it comes to inserting values into the object being iterated over. Simply adjust the test case to the v4 behavior. Change-Id: I85774ae98810d8c14ee457138ccc54082de47802 Reviewed-by: Simon Hausmann --- diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp index c9f6fc4..30a113f 100644 --- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp +++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp @@ -1835,7 +1835,7 @@ void tst_QJSEngine::jsForInStatement_mutateWhileIterating() QJSValue ret = eng.evaluate("o = { p: 123 }; r = [];" "for (var p in o) { r[r.length] = p; o.q = 456; } r"); QStringList lst = qjsvalue_cast(ret); - QCOMPARE(lst.size(), 1); + QCOMPARE(lst.size(), 2); QCOMPARE(lst.at(0), QString::fromLatin1("p")); }