diff options
author | Liang Qi <liang.qi@digia.com> | 2013-10-03 10:30:53 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-20 10:06:12 +0100 |
commit | 6d4d98bc593289d4418a1ab83f00dca0608da23e (patch) | |
tree | 86e4cefff6769fb6bc86bc06b614f9fba5f32944 /tests/auto/qml/qqmlecmascript | |
parent | d53313288e61e3e530f07fcc48ebd024bc11da35 (diff) |
V4: fix Array.indexOf() for QStringList
Autotest is included.
Task-number: QTBUG-33542
Change-Id: I46c3a81006019c6613a3d35aa018217f85a15d0b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Liang Qi <liang.qi@digia.com>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/data/sequenceConversion.indexes.qml | 13 | ||||
-rw-r--r-- | tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/sequenceConversion.indexes.qml b/tests/auto/qml/qqmlecmascript/data/sequenceConversion.indexes.qml index 962e8dd474..a3f306f717 100644 --- a/tests/auto/qml/qqmlecmascript/data/sequenceConversion.indexes.qml +++ b/tests/auto/qml/qqmlecmascript/data/sequenceConversion.indexes.qml @@ -72,4 +72,17 @@ Item { if (!verifyExpected(msco.intListProperty, 4)) success = false; } + + function indexOf() { + if (msco.qstringListProperty.length != 4) + success = false; + if (msco.qstringListProperty.indexOf("first") != 0) + success = false; + if (msco.qstringListProperty.indexOf("second") != 1) + success = false; + if (msco.qstringListProperty.indexOf("third") != 2) + success = false; + if (msco.qstringListProperty.indexOf("fourth") != 3) + success = false; + } } diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 3aa8fd42e0..6b19c13109 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -5433,6 +5433,8 @@ void tst_qqmlecmascript::sequenceConversionIndexes() QTest::ignoreMessage(QtWarningMsg, qPrintable(w3)); QMetaObject::invokeMethod(object, "indexedAccess"); QVERIFY(object->property("success").toBool()); + QMetaObject::invokeMethod(object, "indexOf"); + QVERIFY(object->property("success").toBool()); delete object; } |