diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2011-10-25 09:49:22 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-26 07:30:56 +0200 |
commit | bd690fa7a62463280c98661e1aa54dd12c60b2d1 (patch) | |
tree | cb860fce55d591a375d33b6b1db3803287d2ef14 /tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | |
parent | fa30c9ae2577cd99b3025012e5af63af21fcc58d (diff) |
Add test for bug with typeof in imported js files.
Task-number: QTBUG-21864
Change-Id: I0fc9dc02f7ec00a2f7234484f5afafbbfe7ffca0
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 33604ddcbf..31aefd264e 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -195,6 +195,7 @@ private slots: void nonscriptable(); void deleteLater(); void in(); + void typeOf(); void sharedAttachedObject(); void objectName(); void writeRemovesBinding(); @@ -4512,6 +4513,25 @@ void tst_qdeclarativeecmascript::in() delete o; } +void tst_qdeclarativeecmascript::typeOf() +{ + QDeclarativeComponent component(&engine, TEST_FILE("typeOf.qml")); + QObject *o = component.create(); + QVERIFY(o != 0); + QCOMPARE(o->property("test1").toString(), QLatin1String("undefined")); + QEXPECT_FAIL("", "QTBUG-21864", Abort); + QCOMPARE(o->property("test2").toString(), QLatin1String("object")); + QCOMPARE(o->property("test3").toString(), QLatin1String("number")); + QCOMPARE(o->property("test4").toString(), QLatin1String("string")); + QCOMPARE(o->property("test5").toString(), QLatin1String("function")); + QCOMPARE(o->property("test6").toString(), QLatin1String("object")); + QCOMPARE(o->property("test7").toString(), QLatin1String("undefined")); + QCOMPARE(o->property("test8").toString(), QLatin1String("boolean")); + QCOMPARE(o->property("test9").toString(), QLatin1String("object")); + + delete o; +} + void tst_qdeclarativeecmascript::sharedAttachedObject() { QDeclarativeComponent component(&engine, TEST_FILE("sharedAttachedObject.qml")); |