summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-01-13 11:13:56 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-01-13 11:13:56 (GMT)
commitad4535cf5a053ad3ccf6fe6641da7632b1976160 (patch)
tree914eb583e4e0815d75b4324d6778ef0537ba913b /tests
parent9ff210a8ba748ce3d46441886c8feb407e3aa9a6 (diff)
parentb034416ab293a71fcedd744d503a30365b664049 (diff)
downloadQt-ad4535cf5a053ad3ccf6fe6641da7632b1976160.zip
Qt-ad4535cf5a053ad3ccf6fe6641da7632b1976160.tar.gz
Qt-ad4535cf5a053ad3ccf6fe6641da7632b1976160.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: Fix doc typo Document centerIn and fill in the anchors docs Document level of support for QGraphicsObject properties Add an autotest for QVariant method params Don't crash Qt Creator when debugging an object alias Consistent Docs
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/testtypes.h2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp16
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
index 7724335..6c6ad1f 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
+++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
@@ -624,6 +624,8 @@ public:
Q_INVOKABLE int method_default(int a, int b = 19) { invoke(20); m_actuals << a << b; return b; }
+ Q_INVOKABLE void method_QVariant(QVariant a, QVariant b = QVariant()) { invoke(21); m_actuals << a << b; }
+
private:
friend class MyInvokableBaseObject;
void invoke(int idx) { if (m_invoked != -1) m_invokedError = true; m_invoked = idx;}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
index 90006a9..034adf7 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
+++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
@@ -1786,6 +1786,22 @@ void tst_qdeclarativeecmascript::callQtInvokables()
QCOMPARE(o.invoked(), -3);
QCOMPARE(o.actuals().count(), 1);
QCOMPARE(o.actuals().at(0), QVariant(9));
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_QVariant(9)").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 21);
+ QCOMPARE(o.actuals().count(), 2);
+ QCOMPARE(o.actuals().at(0), QVariant(9));
+ QCOMPARE(o.actuals().at(1), QVariant());
+
+ o.reset();
+ QCOMPARE(engine->evaluate("object.method_QVariant(\"Hello\", \"World\")").isUndefined(), true);
+ QCOMPARE(o.error(), false);
+ QCOMPARE(o.invoked(), 21);
+ QCOMPARE(o.actuals().count(), 2);
+ QCOMPARE(o.actuals().at(0), QVariant(QString("Hello")));
+ QCOMPARE(o.actuals().at(1), QVariant(QString("World")));
}
// QTBUG-13047 (check that you can pass registered object types as args)