tests/auto/qscriptvalue/tst_qscriptvalue.cpp
branchRCL_3
changeset 8 3f74d0d4af4c
parent 5 d3bac044e0f0
child 14 c0432d11811c
--- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp	Mon Mar 15 12:43:09 2010 +0200
+++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp	Thu Apr 08 14:19:33 2010 +0300
@@ -2571,6 +2571,10 @@
         // call with something else as arguments
         QScriptValue ret5 = fun.call(QScriptValue(), QScriptValue(&eng, 123.0));
         QCOMPARE(ret5.isError(), true);
+        // call with a non-array object as arguments
+        QScriptValue ret6 = fun.call(QScriptValue(), eng.globalObject());
+        QVERIFY(ret6.isError());
+        QCOMPARE(ret6.toString(), QString::fromLatin1("TypeError: Arguments must be an array"));
     }
 
     // calling things that are not functions
@@ -2703,6 +2707,10 @@
         // construct with something else as arguments
         QScriptValue ret5 = fun.construct(QScriptValue(&eng, 123.0));
         QCOMPARE(ret5.isError(), true);
+        // construct with a non-array object as arguments
+        QScriptValue ret6 = fun.construct(eng.globalObject());
+        QVERIFY(ret6.isError());
+        QCOMPARE(ret6.toString(), QString::fromLatin1("TypeError: Arguments must be an array"));
     }
 
     // construct on things that are not functions