aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-02-22 10:07:13 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-02-22 10:07:13 +0100
commit3ad752e1c16a3d37a71c5a7527c7e67cc333cdd2 (patch)
treeb63ee3229adc821ff873b091d2d242032d7e0f15 /tests
parent30db7d94e002b5c5b29820050a2220ef06afa54c (diff)
parentdca09f09734fff19a3a5ad930662e0e9abd3cb1b (diff)
Merge remote-tracking branch 'origin/5.12.2' into 5.12
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp42
-rw-r--r--tests/auto/qml/qqmllanguage/data/SignalEmitter.qml14
2 files changed, 26 insertions, 30 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 6a97fc5d8b..788ecce1c5 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -2762,28 +2762,32 @@ void tst_qqmlecmascript::callQtInvokables()
QCOMPARE(o->actuals().at(0), QVariant(QString()));
o->reset();
- QVERIFY(!EVALUATE_VALUE("object.method_QPointF(0)", QV4::Primitive::undefinedValue()));
+ QVERIFY(EVALUATE_VALUE("object.method_QPointF(0)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
- QCOMPARE(o->invoked(), -1);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->invoked(), 12);
+ QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().at(0), QVariant(QPointF()));
o->reset();
- QVERIFY(!EVALUATE_VALUE("object.method_QPointF(null)", QV4::Primitive::undefinedValue()));
+ QVERIFY(EVALUATE_VALUE("object.method_QPointF(null)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
- QCOMPARE(o->invoked(), -1);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->invoked(), 12);
+ QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().at(0), QVariant(QPointF()));
o->reset();
- QVERIFY(!EVALUATE_VALUE("object.method_QPointF(undefined)", QV4::Primitive::undefinedValue()));
+ QVERIFY(EVALUATE_VALUE("object.method_QPointF(undefined)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
- QCOMPARE(o->invoked(), -1);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->invoked(), 12);
+ QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().at(0), QVariant(QPointF()));
o->reset();
- QVERIFY(!EVALUATE_VALUE("object.method_QPointF(object)", QV4::Primitive::undefinedValue()));
+ QVERIFY(EVALUATE_VALUE("object.method_QPointF(object)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
- QCOMPARE(o->invoked(), -1);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->invoked(), 12);
+ QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().at(0), QVariant(QPointF()));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QPointF(object.method_get_QPointF())", QV4::Primitive::undefinedValue()));
@@ -2800,16 +2804,18 @@ void tst_qqmlecmascript::callQtInvokables()
QCOMPARE(o->actuals().at(0), QVariant(QPointF(9, 12)));
o->reset();
- QVERIFY(!EVALUATE_VALUE("object.method_QObject(0)", QV4::Primitive::undefinedValue()));
+ QVERIFY(EVALUATE_VALUE("object.method_QObject(0)", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
- QCOMPARE(o->invoked(), -1);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->invoked(), 13);
+ QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().at(0), qVariantFromValue((QObject *)nullptr));
o->reset();
- QVERIFY(!EVALUATE_VALUE("object.method_QObject(\"Hello world\")", QV4::Primitive::undefinedValue()));
+ QVERIFY(EVALUATE_VALUE("object.method_QObject(\"Hello world\")", QV4::Primitive::undefinedValue()));
QCOMPARE(o->error(), false);
- QCOMPARE(o->invoked(), -1);
- QCOMPARE(o->actuals().count(), 0);
+ QCOMPARE(o->invoked(), 13);
+ QCOMPARE(o->actuals().count(), 1);
+ QCOMPARE(o->actuals().at(0), qVariantFromValue((QObject *)nullptr));
o->reset();
QVERIFY(EVALUATE_VALUE("object.method_QObject(null)", QV4::Primitive::undefinedValue()));
diff --git a/tests/auto/qml/qqmllanguage/data/SignalEmitter.qml b/tests/auto/qml/qqmllanguage/data/SignalEmitter.qml
index 31fe5e4a5e..259f45b7d2 100644
--- a/tests/auto/qml/qqmllanguage/data/SignalEmitter.qml
+++ b/tests/auto/qml/qqmllanguage/data/SignalEmitter.qml
@@ -10,18 +10,8 @@ QtObject {
signal testSignal(SignalParam spp);
function emitTestSignal() {
- var caught = false;
- try {
- testObject.expectNull = true;
- testSignal(op);
- } catch(e) {
- // good: We want a type error here
- caught = true;
- if (handleSignal)
- testObject.determineSuccess(null);
- }
- if (!caught && handleSignal)
- testObject.determineSuccess("fail");
+ testObject.expectNull = true;
+ testSignal(op);
testObject.expectNull = false;
testSignal(p);