diff options
Diffstat (limited to 'tests/auto/declarative/qmlconnection/tst_qmlconnection.cpp')
-rw-r--r-- | tests/auto/declarative/qmlconnection/tst_qmlconnection.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlconnection/tst_qmlconnection.cpp b/tests/auto/declarative/qmlconnection/tst_qmlconnection.cpp index c6d2cc4..b21da48 100644 --- a/tests/auto/declarative/qmlconnection/tst_qmlconnection.cpp +++ b/tests/auto/declarative/qmlconnection/tst_qmlconnection.cpp @@ -44,6 +44,7 @@ #include <private/qmlconnection_p.h> #include <private/qmlgraphicsitem_p.h> #include "../../../shared/util.h" +#include <QtDeclarative/qmlscriptstring.h> class tst_qmlconnection : public QObject @@ -53,6 +54,8 @@ public: tst_qmlconnection(); private slots: + void defaultValues(); + void properties(); void connection(); private: @@ -63,6 +66,36 @@ tst_qmlconnection::tst_qmlconnection() { } +void tst_qmlconnection::defaultValues() +{ + QmlEngine engine; + QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/test-connection3.qml")); + QmlConnection *item = qobject_cast<QmlConnection*>(c.create()); + + QVERIFY(item != 0); + QVERIFY(item->signalSender() == 0); + QCOMPARE(item->script().script(), QString()); + QCOMPARE(item->signal(), QString()); + + delete item; +} + +void tst_qmlconnection::properties() +{ + QmlEngine engine; + QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/test-connection2.qml")); + QmlConnection *item = qobject_cast<QmlConnection*>(c.create()); + + QVERIFY(item != 0); + + QVERIFY(item != 0); + QVERIFY(item->signalSender() == item); + QCOMPARE(item->script().script(), QString("1 == 1")); + QCOMPARE(item->signal(), QString("widthChanged()")); + + delete item; +} + void tst_qmlconnection::connection() { QmlEngine engine; |