summaryrefslogtreecommitdiffstats
path: root/tests/auto/qscriptvalue
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-10-29 16:06:48 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-10-29 16:06:48 (GMT)
commit7db218d6860a04df238735ff692010f0910d0c92 (patch)
treead8033623855b3afb17752552ca56b096c1b9159 /tests/auto/qscriptvalue
parent8943b44c38ee6244c4a5b190c2b35879b1921843 (diff)
parentc02ef9eb331f03dbd59d2fd938c53b54f5c65cea (diff)
downloadQt-7db218d6860a04df238735ff692010f0910d0c92.zip
Qt-7db218d6860a04df238735ff692010f0910d0c92.tar.gz
Qt-7db218d6860a04df238735ff692010f0910d0c92.tar.bz2
Merge branch 4.7 into qt-master-from-4.7
Diffstat (limited to 'tests/auto/qscriptvalue')
-rw-r--r--tests/auto/qscriptvalue/tst_qscriptvalue.cpp25
-rw-r--r--tests/auto/qscriptvalue/tst_qscriptvalue.h1
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
index 18480cc..5e42921a 100644
--- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
+++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
@@ -2756,6 +2756,31 @@ void tst_QScriptValue::construct()
QVERIFY(!QScriptValue(QScriptValue::NullValue).construct().isValid());
}
+void tst_QScriptValue::construct_constructorThrowsPrimitive()
+{
+ QScriptEngine eng;
+ QScriptValue fun = eng.evaluate("(function() { throw 123; })");
+ QVERIFY(fun.isFunction());
+ // construct(QScriptValueList)
+ {
+ QScriptValue ret = fun.construct();
+ QVERIFY(ret.isNumber());
+ QCOMPARE(ret.toNumber(), 123.0);
+ QVERIFY(eng.hasUncaughtException());
+ QVERIFY(ret.strictlyEquals(eng.uncaughtException()));
+ eng.clearExceptions();
+ }
+ // construct(QScriptValue)
+ {
+ QScriptValue ret = fun.construct(eng.newArray());
+ QVERIFY(ret.isNumber());
+ QCOMPARE(ret.toNumber(), 123.0);
+ QVERIFY(eng.hasUncaughtException());
+ QVERIFY(ret.strictlyEquals(eng.uncaughtException()));
+ eng.clearExceptions();
+ }
+}
+
void tst_QScriptValue::lessThan_old()
{
QScriptEngine eng;
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.h b/tests/auto/qscriptvalue/tst_qscriptvalue.h
index 8bfaa6a..462749a 100644
--- a/tests/auto/qscriptvalue/tst_qscriptvalue.h
+++ b/tests/auto/qscriptvalue/tst_qscriptvalue.h
@@ -219,6 +219,7 @@ private slots:
void getSetScriptClass();
void call();
void construct();
+ void construct_constructorThrowsPrimitive();
void castToPointer();
void prettyPrinter_data();
void prettyPrinter();