aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2011-11-17 12:53:26 +1000
committerQt by Nokia <qt-info@nokia.com>2011-11-20 23:23:38 +0100
commit7e8e6b2d5be6419374cefdd2acf5c328890f2ec3 (patch)
treede535f788492a36f1d439f06e5bc65bf787f5446 /tests
parent62a31676830aca745df23a5dc18b59c4211eea56 (diff)
Rewrite signal handlers at compile time.
Task-number: QTBUG-22726 Change-Id: If2c3c00c646b2ed6b6899573a0b487c8deeaad3f Reviewed-by: Kai Koehne <kai.koehne@nokia.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/debugger/qdeclarativeenginedebug/tst_qdeclarativeenginedebug.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/auto/declarative/debugger/qdeclarativeenginedebug/tst_qdeclarativeenginedebug.cpp b/tests/auto/declarative/debugger/qdeclarativeenginedebug/tst_qdeclarativeenginedebug.cpp
index 65333cca2b..f48b281d3a 100644
--- a/tests/auto/declarative/debugger/qdeclarativeenginedebug/tst_qdeclarativeenginedebug.cpp
+++ b/tests/auto/declarative/debugger/qdeclarativeenginedebug/tst_qdeclarativeenginedebug.cpp
@@ -53,6 +53,7 @@
#include <QtDeclarative/qquickitem.h>
#include <private/qdeclarativebinding_p.h>
+#include <private/qdeclarativeboundsignal_p.h>
#include <private/qdeclarativeenginedebug_p.h>
#include <private/qdeclarativedebugservice_p.h>
#include <private/qdeclarativemetatype_p.h>
@@ -209,7 +210,15 @@ void tst_QDeclarativeEngineDebug::recursiveObjectTest(QObject *o, const QDeclara
// signal properties are fake - they are generated from QDeclarativeBoundSignal children
if (p.name().startsWith("on") && p.name().length() > 2 && p.name()[2].isUpper()) {
- QVERIFY(p.value().toString().startsWith('{') && p.value().toString().endsWith('}'));
+ QList<QDeclarativeBoundSignal*> signalHandlers = o->findChildren<QDeclarativeBoundSignal*>();
+ QString signal = p.value().toString();
+ bool found = false;
+ for (int i = 0; i < signalHandlers.count(); ++i)
+ if (signalHandlers.at(i)->expression()->expression() == signal) {
+ found = true;
+ break;
+ }
+ QVERIFY(found);
QVERIFY(p.valueTypeName().isEmpty());
QVERIFY(p.binding().isEmpty());
QVERIFY(!p.hasNotifySignal());
@@ -1031,7 +1040,7 @@ void tst_QDeclarativeEngineDebug::setBindingForObject()
QDeclarativeDebugPropertyReference onEnteredRef = findProperty(mouseAreaObject.properties(), "onEntered");
QCOMPARE(onEnteredRef.name(), QString("onEntered"));
- QCOMPARE(onEnteredRef.value(), QVariant("{ console.log('hello') }"));
+ QCOMPARE(onEnteredRef.value(), QVariant("(function onEntered() { { console.log('hello') } })"));
m_dbg->setBindingForObject(mouseAreaObject.debugId(), "onEntered", "{console.log('hello, world') }", false) ;