diff options
author | Robert Griebl <robert.griebl@pelagicore.com> | 2015-01-08 15:33:34 (GMT) |
---|---|---|
committer | Robert Griebl <robert.griebl@pelagicore.com> | 2015-01-08 15:47:10 (GMT) |
commit | 6f55f3dbbb2cdae33a8b0d00b7bf2ada7fe79a04 (patch) | |
tree | 67f5fd2f54ecc3c3dd4fd25a377422ca279773ec /tests/auto | |
parent | 18c5ff04103eadcb532d03d526714385943295ab (diff) | |
download | Qt-6f55f3dbbb2cdae33a8b0d00b7bf2ada7fe79a04.zip Qt-6f55f3dbbb2cdae33a8b0d00b7bf2ada7fe79a04.tar.gz Qt-6f55f3dbbb2cdae33a8b0d00b7bf2ada7fe79a04.tar.bz2 |
Fix empty arrays in QML 1
Commit bb0239e added a regression, where empty arrays would produce errors
in QML 1.
Task-number: QTBUG-43656
Change-Id: I6d416b2387a1dfd3588c000368fc1223d08399bd
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index ac548b1..2ad3c66 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -457,6 +457,12 @@ void tst_qdeclarativeecmascript::arrayExpressions() QCOMPARE(list2.at(1), QVariant(2)); QCOMPARE(list2.at(2), QVariant(QString("foo"))); QCOMPARE(list2.at(3), QVariant(QString("bar"))); + + MyExpression expr3(&context, "[]"); + result = expr3.evaluate(); + QCOMPARE(result.userType(), qMetaTypeId<QList<QObject *> >()); + QList<QObject *> list3 = qvariant_cast<QList<QObject *> >(result); + QCOMPARE(list3.count(), 0); } // Tests that modifying a context property will reevaluate expressions |