summaryrefslogtreecommitdiffstats
path: root/tests/auto/qscriptengine
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2010-07-07 08:24:53 (GMT)
committerKent Hansen <kent.hansen@nokia.com>2010-07-07 08:27:29 (GMT)
commit1350f26569a4ab802ba93dc23e5dcb964a0cd3a5 (patch)
tree486c414e229c4e212bb3b4532a981060b93ddfe5 /tests/auto/qscriptengine
parent401a6552f2601e5ca5b2e00a274baa6dcd83c96e (diff)
downloadQt-1350f26569a4ab802ba93dc23e5dcb964a0cd3a5.zip
Qt-1350f26569a4ab802ba93dc23e5dcb964a0cd3a5.tar.gz
Qt-1350f26569a4ab802ba93dc23e5dcb964a0cd3a5.tar.bz2
Add missing API shims
There were still a couple of functions that didn't have them. This could cause said functions to crash if multiple script engines were being used. Reviewed-by: Jedrzej Nowacki
Diffstat (limited to 'tests/auto/qscriptengine')
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index 6885adf..7a732cc 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -4265,6 +4265,35 @@ void tst_QScriptEngine::reentrancy()
QScriptEngine eng;
QCOMPARE(eng.evaluate("Array()").toString(), QString());
}
+
+ {
+ QScriptEngine eng1;
+ QScriptEngine eng2;
+ {
+ QScriptValue d1 = eng1.newDate(0);
+ QScriptValue d2 = eng2.newDate(0);
+ QCOMPARE(d1.toDateTime(), d2.toDateTime());
+ QCOMPARE(d2.toDateTime(), d1.toDateTime());
+ }
+ {
+ QScriptValue r1 = eng1.newRegExp("foo", "gim");
+ QScriptValue r2 = eng2.newRegExp("foo", "gim");
+ QCOMPARE(r1.toRegExp(), r2.toRegExp());
+ QCOMPARE(r2.toRegExp(), r1.toRegExp());
+ }
+ {
+ QScriptValue o1 = eng1.newQObject(this);
+ QScriptValue o2 = eng2.newQObject(this);
+ QCOMPARE(o1.toQObject(), o2.toQObject());
+ QCOMPARE(o2.toQObject(), o1.toQObject());
+ }
+ {
+ QScriptValue mo1 = eng1.newQMetaObject(&staticMetaObject);
+ QScriptValue mo2 = eng2.newQMetaObject(&staticMetaObject);
+ QCOMPARE(mo1.toQMetaObject(), mo2.toQMetaObject());
+ QCOMPARE(mo2.toQMetaObject(), mo1.toQMetaObject());
+ }
+ }
}
void tst_QScriptEngine:: incDecNonObjectProperty()