diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-07-09 07:42:28 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-07-09 07:42:28 (GMT) |
commit | e8a1c00ca88feeb44cd11cdb9407e646a0f1da76 (patch) | |
tree | 309d2f061d77f5fb723bf997747fcacb1e3d3867 /tests/auto/qscriptvalue | |
parent | 6239633ad3ae2b707ebc491ec1453f791150dc1a (diff) | |
download | Qt-e8a1c00ca88feeb44cd11cdb9407e646a0f1da76.zip Qt-e8a1c00ca88feeb44cd11cdb9407e646a0f1da76.tar.gz Qt-e8a1c00ca88feeb44cd11cdb9407e646a0f1da76.tar.bz2 |
more tests for QScriptValue::call() overload that takes an array
Diffstat (limited to 'tests/auto/qscriptvalue')
-rw-r--r-- | tests/auto/qscriptvalue/tst_qscriptvalue.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp index 6393e7d..9ad47cf 100644 --- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp +++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp @@ -2322,6 +2322,13 @@ void tst_QScriptValue::call() QCOMPARE(result.isNumber(), true); QCOMPARE(result.toNumber(), 123.0); } + { + QScriptValue args = eng.newArray(); + args.setProperty(0, 123); + QScriptValue result = fun.call(eng.undefinedValue(), args); + QVERIFY(result.isNumber()); + QCOMPARE(result.toNumber(), 123.0); + } } { @@ -2337,6 +2344,14 @@ void tst_QScriptValue::call() QCOMPARE(result.isNumber(), true); QCOMPARE(result.toNumber(), 456.0); } + { + QScriptValue args = eng.newArray(); + args.setProperty(0, 123); + args.setProperty(1, 456); + QScriptValue result = fun.call(eng.undefinedValue(), args); + QVERIFY(result.isNumber()); + QCOMPARE(result.toNumber(), 456.0); + } } { @@ -2375,6 +2390,13 @@ void tst_QScriptValue::call() QCOMPARE(result.isNumber(), true); QCOMPARE(result.toNumber(), 123.0); } + { + QScriptValue args = eng.newArray(); + args.setProperty(0, 123); + QScriptValue result = fun.call(eng.undefinedValue(), args); + QVERIFY(result.isNumber()); + QCOMPARE(result.toNumber(), 123.0); + } } { |