diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-31 13:09:24 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-31 13:09:24 (GMT) |
commit | 0373325dd1390682922dd07614214c453d473ce3 (patch) | |
tree | 93267c9f7d2bdd9e387dc5cda34cd6c548cf8e5c /tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | |
parent | b85a41ece042bca5c4e1ac2a6549f2cdc2c6ca1a (diff) | |
parent | d401f416478628ce84afd2cd755f8df91edee22d (diff) | |
download | Qt-0373325dd1390682922dd07614214c453d473ce3.zip Qt-0373325dd1390682922dd07614214c453d473ce3.tar.gz Qt-0373325dd1390682922dd07614214c453d473ce3.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: (21 commits)
Fix bug when adding import paths manually
Update Comment
Optimize QDeclarativeEngine::importExtension
QGraphicsEffect : Don't rely on the exposedArea when rendering the item into the cache.
Fix snapping in listview.
Minor cleanup.
Improve flipable example.
Minor cleanup for visual test framework.
VisibleArea is not a creatable type.
More testing.
Test openUrlExternally
doc
example of WebView onAlert, and of popups in general.
Update examples/declarative.pro
Update mouseX(Y) when clicking on a mouse area
Declarative examples cleanup.
Add test.
doc
Move gitignore to right level, update for Linux.
Cleanup MouseArea visual tests.
...
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index b218d30..77dd4b8 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -129,6 +129,7 @@ private slots: void ownership(); void qlistqobjectMethods(); void strictlyEquals(); + void compiled(); void bug1(); void dynamicCreationCrash(); @@ -2026,6 +2027,44 @@ void tst_qdeclarativeecmascript::strictlyEquals() delete object; } +void tst_qdeclarativeecmascript::compiled() +{ + QDeclarativeComponent component(&engine, TEST_FILE("compiled.qml")); + + QObject *object = component.create(); + QVERIFY(object != 0); + + QCOMPARE(object->property("test1").toReal(), qreal(15.7)); + QCOMPARE(object->property("test2").toReal(), qreal(-6.7)); + QCOMPARE(object->property("test3").toBool(), true); + QCOMPARE(object->property("test4").toBool(), false); + QCOMPARE(object->property("test5").toBool(), false); + QCOMPARE(object->property("test6").toBool(), true); + + QCOMPARE(object->property("test7").toInt(), 185); + QCOMPARE(object->property("test8").toInt(), 167); + QCOMPARE(object->property("test9").toBool(), true); + QCOMPARE(object->property("test10").toBool(), false); + QCOMPARE(object->property("test11").toBool(), false); + QCOMPARE(object->property("test12").toBool(), true); + + QCOMPARE(object->property("test13").toString(), QLatin1String("HelloWorld")); + QCOMPARE(object->property("test14").toString(), QLatin1String("Hello World")); + QCOMPARE(object->property("test15").toBool(), false); + QCOMPARE(object->property("test16").toBool(), true); + + QCOMPARE(object->property("test17").toInt(), 4); + QCOMPARE(object->property("test18").toReal(), qreal(176)); + QEXPECT_FAIL("", "QTBUG-9538", Continue); + QCOMPARE(object->property("test19").toInt(), 6); + QCOMPARE(object->property("test20").toReal(), qreal(6.7)); + QCOMPARE(object->property("test21").toString(), QLatin1String("6.7")); + QCOMPARE(object->property("test22").toString(), QLatin1String("!")); + QCOMPARE(object->property("test23").toBool(), true); + + delete object; +} + QTEST_MAIN(tst_qdeclarativeecmascript) #include "tst_qdeclarativeecmascript.moc" |