summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-07-06 14:57:06 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-07-06 14:57:06 (GMT)
commit292f72349a9ff74320f29b12f725bad6c8c283c4 (patch)
tree4511cf525ccc0385cf430a42729e35a1adfdd09f /tests
parent9769235a26c3bacc597b994fa249516721833389 (diff)
downloadQt-292f72349a9ff74320f29b12f725bad6c8c283c4.zip
Qt-292f72349a9ff74320f29b12f725bad6c8c283c4.tar.gz
Qt-292f72349a9ff74320f29b12f725bad6c8c283c4.tar.bz2
fix QScriptValue::construct() when argument is not array-like
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qscriptvalue/tst_qscriptvalue.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
index 1e49705..69d84b3 100644
--- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
+++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
@@ -2343,8 +2343,10 @@ void tst_QScriptValue::call()
{
QScriptValue result = fun.call();
+ QEXPECT_FAIL("", "Returns null if a function throws an error", Continue);
QCOMPARE(result.isError(), true);
QCOMPARE(eng.hasUncaughtException(), true);
+ QEXPECT_FAIL("", "returns null if a function throws an error", Continue);
QVERIFY(result.strictlyEquals(eng.uncaughtException()));
}
}
@@ -2545,8 +2547,10 @@ void tst_QScriptValue::construct()
QCOMPARE(fun.isFunction(), true);
fun = eng.evaluate("(function() { throw new Error('foo'); })");
QScriptValue ret = fun.construct();
+ QEXPECT_FAIL("", "Returns null if a constructor throws an error", Continue);
QCOMPARE(ret.isError(), true);
QCOMPARE(eng.hasUncaughtException(), true);
+ QEXPECT_FAIL("", "Returns null if a constructor throws an error", Continue);
QVERIFY(ret.strictlyEquals(eng.uncaughtException()));
}
@@ -2555,6 +2559,9 @@ void tst_QScriptValue::construct()
{
QScriptValue fun = eng.evaluate("function() { return arguments; }");
+ QEXPECT_FAIL("", "JSC parser doesn't understand function expressions", Continue);
+ QVERIFY(fun.isFunction());
+ fun = eng.evaluate("(function() { return arguments; })");
QScriptValue array = eng.newArray(3);
array.setProperty(0, QScriptValue(&eng, 123.0));
array.setProperty(1, QScriptValue(&eng, 456.0));
@@ -2562,6 +2569,7 @@ void tst_QScriptValue::construct()
// construct with single array object as arguments
QScriptValue ret = fun.construct(array);
QVERIFY(!eng.hasUncaughtException());
+ QVERIFY(ret.isValid());
QVERIFY(ret.isObject());
QCOMPARE(ret.property(0).strictlyEquals(array.property(0)), true);
QCOMPARE(ret.property(1).strictlyEquals(array.property(1)), true);