summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/declarative/qmlecmascript/data/bug.1.qml10
-rw-r--r--tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp22
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"