From 3491cdb2c1c9184adfb0fab1e636afd784a6565e Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 14 Oct 2009 09:17:53 +1000 Subject: fix test (data now shadowed, Script changed) --- tests/auto/declarative/qbindablemap/tst_qbindablemap.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/auto/declarative/qbindablemap/tst_qbindablemap.cpp b/tests/auto/declarative/qbindablemap/tst_qbindablemap.cpp index c9c37ab..c1b31c2 100644 --- a/tests/auto/declarative/qbindablemap/tst_qbindablemap.cpp +++ b/tests/auto/declarative/qbindablemap/tst_qbindablemap.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include class tst_QBindableMap : public QObject @@ -58,11 +59,13 @@ void tst_QBindableMap::changed() //make changes in QML QmlEngine engine; QmlContext *ctxt = engine.rootContext(); - ctxt->setContextProperty(QLatin1String("data"), &map); - QmlComponent component(&engine, "import Qt 4.6\nScript { script: \"data.key1 = 'Hello World';\" }", + ctxt->setContextProperty(QLatin1String("testdata"), &map); + QmlComponent component(&engine, "import Qt 4.6\nText { text: { testdata.key1 = 'Hello World'; 'X' } }", QUrl("file://")); QVERIFY(component.isReady()); - component.create(); + QFxText *txt = qobject_cast(component.create()); + QVERIFY(txt); + QCOMPARE(txt->text(), QString('X')); QCOMPARE(spy.count(), 1); QList arguments = spy.takeFirst(); QCOMPARE(arguments.at(0).toString(),QLatin1String("key1")); -- cgit v0.12