diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-12-14 04:58:54 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-12-14 04:58:54 (GMT) |
commit | 0dcab84aa2ec72afbfe4834cd98f70daded77bf4 (patch) | |
tree | 1821b73055e0c47b63703c9a5f97e355ba43a2a1 /tests/auto | |
parent | 8e466a30af34c5bb83e7fc591ddf569e2ec79d9f (diff) | |
download | Qt-0dcab84aa2ec72afbfe4834cd98f70daded77bf4.zip Qt-0dcab84aa2ec72afbfe4834cd98f70daded77bf4.tar.gz Qt-0dcab84aa2ec72afbfe4834cd98f70daded77bf4.tar.bz2 |
QTBUG-6781 testcase
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/declarative/qmlecmascript/data/bug.1.qml | 10 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp | 22 |
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlecmascript/data/bug.1.qml b/tests/auto/declarative/qmlecmascript/data/bug.1.qml new file mode 100644 index 0000000..266de76 --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/bug.1.qml @@ -0,0 +1,10 @@ +import Qt 4.6 + +QtObject { + property int a: 10 + property bool b: false + + property int test + + test: ((a == 10)?(a + 1):0) + ((b == true)?9:3) +} diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp index 749f803..b9a2241 100644 --- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp +++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp @@ -111,6 +111,8 @@ private slots: void shutdownErrors(); void externalScript(); + void bug1(); + private: QmlEngine engine; }; @@ -1015,6 +1017,26 @@ void tst_qmlecmascript::externalScript() } } +void tst_qmlecmascript::bug1() +{ + QmlComponent component(&engine, TEST_FILE("bug.1.qml")); + QObject *object = component.create(); + QVERIFY(object != 0); + + QCOMPARE(object->property("test").toInt(), 14); + + object->setProperty("a", 11); + + QCOMPARE(object->property("test").toInt(), 3); + + object->setProperty("b", true); + + QEXPECT_FAIL("", "QTBUG-6781", Continue); + QCOMPARE(object->property("test").toInt(), 9); + + delete object; +} + QTEST_MAIN(tst_qmlecmascript) #include "tst_qmlecmascript.moc" |