aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorCharles Yin <charles.yin@nokia.com>2011-09-06 13:54:46 +1000
committerQt by Nokia <qt-info@nokia.com>2011-09-06 10:31:39 +0200
commit0fdd97f613af6ae255e9cd1470ad8d4d67091dd7 (patch)
treeaeed6d854834c97da878743f6a8fbb99ff1bb421 /tests
parent36de9924764c90bd963bf1cdabe170bff3ae8a70 (diff)
more fixes for QTBUG-17868
QDeclarativePropertyCache bypasses the previous fix, need to check the property name when property cache try to create property. Change-Id: Ibccc02df568a8ded3626bb914150ba9ee87d238f Task-number:QTBUG-17868 Reviewed-on: http://codereview.qt.nokia.com/4230 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp b/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp
index 5583701b12..966ac1950c 100644
--- a/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp
+++ b/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp
@@ -61,6 +61,7 @@ private slots:
void count();
void crashBug();
+ void QTBUG_17868();
};
void tst_QDeclarativePropertyMap::insert()
@@ -218,6 +219,23 @@ void tst_QDeclarativePropertyMap::crashBug()
delete obj;
}
+void tst_QDeclarativePropertyMap::QTBUG_17868()
+{
+ QDeclarativePropertyMap map;
+
+ QDeclarativeEngine engine;
+ QDeclarativeContext context(&engine);
+ context.setContextProperty("map", &map);
+ map.insert("key", 1);
+ QDeclarativeComponent c(&engine);
+ c.setData("import QtQuick 2.0\nItem {property bool error:false; Component.onCompleted: {try{console.log(map.keys());}catch(e) {error=true;}}}",QUrl());
+ QObject *obj = c.create(&context);
+ QVERIFY(obj);
+ QVERIFY(!obj->property("error").toBool());
+ delete obj;
+
+}
+
QTEST_MAIN(tst_QDeclarativePropertyMap)
#include "tst_qdeclarativepropertymap.moc"