diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2011-08-04 02:00:53 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2011-08-04 02:02:30 (GMT) |
commit | 29d988d113aac1a193d3af6247a6e8231f3f3c9e (patch) | |
tree | 0a39f59f7b665ef7e54896ceb701c046b18247fc /tests/auto/declarative/qdeclarativeecmascript | |
parent | 422f4e8ec53b917fad09a3e671fd93048dde72ed (diff) | |
download | Qt-29d988d113aac1a193d3af6247a6e8231f3f3c9e.zip Qt-29d988d113aac1a193d3af6247a6e8231f3f3c9e.tar.gz Qt-29d988d113aac1a193d3af6247a6e8231f3f3c9e.tar.bz2 |
Don't release register prematurely
Task-number: QTBUG-20648
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript')
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/data/qtbug_20648.qml | 7 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_20648.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_20648.qml new file mode 100644 index 0000000..40f21ef --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_20648.qml @@ -0,0 +1,7 @@ +import QtQuick 1.0 + +QtObject { + property bool hd: true + + property real test: ((hd ? 100 : 20) + 0) +} diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 71214a3..bf7c9a4 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -177,6 +177,7 @@ private slots: void aliasWritesOverrideBindings(); void pushCleanContext(); void realToInt(); + void qtbug_20648(); void include(); @@ -3090,6 +3091,15 @@ void tst_qdeclarativeecmascript::realToInt() QCOMPARE(object->value(), int(8)); } +void tst_qdeclarativeecmascript::qtbug_20648() +{ + QDeclarativeComponent component(&engine, TEST_FILE("qtbug_20648.qml")); + QObject *o = component.create(); + QVERIFY(o != 0); + QCOMPARE(o->property("test").toInt(), 100); + delete o; +} + QTEST_MAIN(tst_qdeclarativeecmascript) #include "tst_qdeclarativeecmascript.moc" |