diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-05-11 05:07:46 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-05-11 05:07:46 (GMT) |
commit | b4c589868f278aa9a58ab9afa727dbf0a9442e22 (patch) | |
tree | 98381c0770242ab1b177a875042df7dcb0bed886 /tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp | |
parent | 03f8f1df0d88f5ffe0b3120cffce614cbeefdb70 (diff) | |
parent | 367798c3cfaac56d82b29a90061d621e2b5854a5 (diff) | |
download | Qt-b4c589868f278aa9a58ab9afa727dbf0a9442e22.zip Qt-b4c589868f278aa9a58ab9afa727dbf0a9442e22.tar.gz Qt-b4c589868f278aa9a58ab9afa727dbf0a9442e22.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: (144 commits)
Correct Flipable back item based on parent, not scene transform
Round ideal width up to prevent incorrect word wrapping on Mac OS X
Correct ownership of signal handlers in state changes.
Remove unnecesary check for debug output.
Error message on QWS appears to have changed.
Removed multimedia effects from tvtennis declarative example
Add some test asserts
Fixes doc of mouse area's onEntered
Remove debug messages from mousearea autotest file
Prevent handling of Up/Down on Mac OS X, for consistency with other platforms.
Optimize QGW constructor.
There is no Qt.widgets
Avoid changing header dependencies.
Avoid many unnecessary allocations, so so that paint engines attached to pixmaps
Doc
Fix autotests
Fix autotests (remove import Qt.widgets)
Add missing qml file to qdeclarativemousearea
Doc fix
Clean up example code, add white background behind text
...
Diffstat (limited to 'tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp b/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp index 0efae3b..00e97ca 100644 --- a/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp +++ b/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp @@ -59,6 +59,8 @@ private slots: void connection(); void trimming(); void targetChanged(); + void unknownSignals_data(); + void unknownSignals(); private: QDeclarativeEngine engine; @@ -156,6 +158,41 @@ void tst_qdeclarativeconnection::targetChanged() delete item; } +void tst_qdeclarativeconnection::unknownSignals_data() +{ + QTest::addColumn<QString>("file"); + QTest::addColumn<QString>("error"); + + QTest::newRow("basic") << "connection-unknownsignals.qml" << ":6:5: QML Connections: Cannot assign to non-existent property \"onFooBar\""; + QTest::newRow("parent") << "connection-unknownsignals-parent.qml" << ":6:5: QML Connections: Cannot assign to non-existent property \"onFooBar\""; + QTest::newRow("ignored") << "connection-unknownsignals-ignored.qml" << ""; // should be NO error + QTest::newRow("notarget") << "connection-unknownsignals-notarget.qml" << ""; // should be NO error +} + +void tst_qdeclarativeconnection::unknownSignals() +{ + QFETCH(QString, file); + QFETCH(QString, error); + + QUrl url = QUrl::fromLocalFile(SRCDIR "/data/" + file); + if (!error.isEmpty()) { + QTest::ignoreMessage(QtWarningMsg, (url.toString() + error).toLatin1()); + } else { + // QTest has no way to insist no message (i.e. fail) + } + + QDeclarativeEngine engine; + QDeclarativeComponent c(&engine, url); + QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(c.create()); + QVERIFY(item != 0); + + // check that connection is created (they are all runtime errors) + QDeclarativeConnections *connections = item->findChild<QDeclarativeConnections*>("connections"); + QVERIFY(connections); + + delete item; +} + QTEST_MAIN(tst_qdeclarativeconnection) #include "tst_qdeclarativeconnection.moc" |