diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-25 12:24:36 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-28 13:33:24 +0200 |
commit | cf2a253f2f60c9f0c61682527d80143e72b355d4 (patch) | |
tree | d60e8be50437e6f15513e25155817b902a2062c7 /tests | |
parent | 7872b380063d0497ba62fecfdc92148f1ea947af (diff) |
Move Value::fromBool, ... to a new Primitive class
This will simplify finding the remaining direct usages of
QV4::Value that need fixing.
Change-Id: I223099727436d5748027c84c53d9dfc4028e38ed
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 42d2719d00..4240ed6dcb 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -2331,7 +2331,7 @@ static inline QV4::Value evaluate(QV8Engine *engine, const QV4::Value & o, try { QV4::Scoped<QV4::FunctionObject> function(scope, program.run()); if (!function) - return QV4::Value::undefinedValue(); + return QV4::Primitive::undefinedValue(); QV4::ScopedCallData d(scope, 1); d->args[0] = o; d->thisObject = engine->global(); @@ -2340,7 +2340,7 @@ static inline QV4::Value evaluate(QV8Engine *engine, const QV4::Value & o, } catch (QV4::Exception &e) { e.accept(ctx); } - return QV4::Value::undefinedValue(); + return QV4::Primitive::undefinedValue(); } #define EVALUATE_ERROR(source) evaluate_error(engine, object, source) @@ -2389,14 +2389,14 @@ void tst_qqmlecmascript::callQtInvokables() // Excessive arguments o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_int(10, 11)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_int(10, 11)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 8); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), QVariant(10)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_intint(10, 11, 12)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_intint(10, 11, 12)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 9); QCOMPARE(o->actuals().count(), 2); @@ -2405,19 +2405,19 @@ void tst_qqmlecmascript::callQtInvokables() // Test return types o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_NoArgs()", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_NoArgs()", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 0); QCOMPARE(o->actuals().count(), 0); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_NoArgs_int()", QV4::Value::fromInt32(6))); + QVERIFY(EVALUATE_VALUE("object.method_NoArgs_int()", QV4::Primitive::fromInt32(6))); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 1); QCOMPARE(o->actuals().count(), 0); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_NoArgs_real()", QV4::Value::fromDouble(19.75))); + QVERIFY(EVALUATE_VALUE("object.method_NoArgs_real()", QV4::Primitive::fromDouble(19.75))); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 2); QCOMPARE(o->actuals().count(), 0); @@ -2467,49 +2467,49 @@ void tst_qqmlecmascript::callQtInvokables() // Test arg types o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_int(94)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_int(94)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 8); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), QVariant(94)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_int(\"94\")", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_int(\"94\")", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 8); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), QVariant(94)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_int(\"not a number\")", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_int(\"not a number\")", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 8); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), QVariant(0)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_int(null)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_int(null)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 8); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), QVariant(0)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_int(undefined)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_int(undefined)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 8); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), QVariant(0)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_int(object)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_int(object)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 8); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), QVariant(0)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_intint(122, 9)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_intint(122, 9)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 9); QCOMPARE(o->actuals().count(), 2); @@ -2517,56 +2517,56 @@ void tst_qqmlecmascript::callQtInvokables() QCOMPARE(o->actuals().at(1), QVariant(9)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_real(94.3)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_real(94.3)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 10); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), QVariant(94.3)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_real(\"94.3\")", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_real(\"94.3\")", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 10); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), QVariant(94.3)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_real(\"not a number\")", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_real(\"not a number\")", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 10); QCOMPARE(o->actuals().count(), 1); QVERIFY(qIsNaN(o->actuals().at(0).toDouble())); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_real(null)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_real(null)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 10); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), QVariant(0)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_real(undefined)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_real(undefined)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 10); QCOMPARE(o->actuals().count(), 1); QVERIFY(qIsNaN(o->actuals().at(0).toDouble())); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_real(object)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_real(object)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 10); QCOMPARE(o->actuals().count(), 1); QVERIFY(qIsNaN(o->actuals().at(0).toDouble())); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QString(\"Hello world\")", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QString(\"Hello world\")", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 11); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), QVariant("Hello world")); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QString(19)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QString(19)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 11); QCOMPARE(o->actuals().count(), 1); @@ -2575,7 +2575,7 @@ void tst_qqmlecmascript::callQtInvokables() o->reset(); { QString expected = "MyInvokableObject(0x" + QString::number((quintptr)o, 16) + ")"; - QVERIFY(EVALUATE_VALUE("object.method_QString(object)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QString(object)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 11); QCOMPARE(o->actuals().count(), 1); @@ -2583,126 +2583,126 @@ void tst_qqmlecmascript::callQtInvokables() } o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QString(null)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QString(null)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 11); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), QVariant(QString())); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QString(undefined)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QString(undefined)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 11); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), QVariant(QString())); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QPointF(0)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QPointF(0)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); 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::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QPointF(null)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); 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::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QPointF(undefined)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); 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::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QPointF(object)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); 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::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QPointF(object.method_get_QPointF())", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 12); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), QVariant(QPointF(99.3, -10.2))); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QPointF(object.method_get_QPoint())", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QPointF(object.method_get_QPoint())", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 12); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), QVariant(QPointF(9, 12))); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QObject(0)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QObject(0)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 13); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), qVariantFromValue((QObject *)0)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QObject(\"Hello world\")", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QObject(\"Hello world\")", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 13); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), qVariantFromValue((QObject *)0)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QObject(null)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QObject(null)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 13); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), qVariantFromValue((QObject *)0)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QObject(undefined)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QObject(undefined)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 13); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), qVariantFromValue((QObject *)0)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QObject(object)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QObject(object)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 13); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), qVariantFromValue((QObject *)o)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QScriptValue(null)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QScriptValue(null)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 14); QCOMPARE(o->actuals().count(), 1); QVERIFY(qvariant_cast<QJSValue>(o->actuals().at(0)).isNull()); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QScriptValue(undefined)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QScriptValue(undefined)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 14); QCOMPARE(o->actuals().count(), 1); QVERIFY(qvariant_cast<QJSValue>(o->actuals().at(0)).isUndefined()); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QScriptValue(19)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QScriptValue(19)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 14); QCOMPARE(o->actuals().count(), 1); QVERIFY(qvariant_cast<QJSValue>(o->actuals().at(0)).strictlyEquals(QJSValue(19))); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QScriptValue([19, 20])", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QScriptValue([19, 20])", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 14); QCOMPARE(o->actuals().count(), 1); QVERIFY(qvariant_cast<QJSValue>(o->actuals().at(0)).isArray()); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_intQScriptValue(4, null)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_intQScriptValue(4, null)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 15); QCOMPARE(o->actuals().count(), 2); @@ -2710,7 +2710,7 @@ void tst_qqmlecmascript::callQtInvokables() QVERIFY(qvariant_cast<QJSValue>(o->actuals().at(1)).isNull()); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_intQScriptValue(8, undefined)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_intQScriptValue(8, undefined)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 15); QCOMPARE(o->actuals().count(), 2); @@ -2718,7 +2718,7 @@ void tst_qqmlecmascript::callQtInvokables() QVERIFY(qvariant_cast<QJSValue>(o->actuals().at(1)).isUndefined()); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_intQScriptValue(3, 19)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_intQScriptValue(3, 19)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 15); QCOMPARE(o->actuals().count(), 2); @@ -2726,7 +2726,7 @@ void tst_qqmlecmascript::callQtInvokables() QVERIFY(qvariant_cast<QJSValue>(o->actuals().at(1)).strictlyEquals(QJSValue(19))); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_intQScriptValue(44, [19, 20])", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_intQScriptValue(44, [19, 20])", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 15); QCOMPARE(o->actuals().count(), 2); @@ -2740,14 +2740,14 @@ void tst_qqmlecmascript::callQtInvokables() QCOMPARE(o->actuals().count(), 0); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_overload(10)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_overload(10)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 16); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), QVariant(10)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_overload(10, 11)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_overload(10, 11)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 17); QCOMPARE(o->actuals().count(), 2); @@ -2755,21 +2755,21 @@ void tst_qqmlecmascript::callQtInvokables() QCOMPARE(o->actuals().at(1), QVariant(11)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_overload(\"Hello\")", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_overload(\"Hello\")", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 18); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), QVariant(QString("Hello"))); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_with_enum(9)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_with_enum(9)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 19); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), QVariant(9)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_default(10)", QV4::Value::fromInt32(19))); + QVERIFY(EVALUATE_VALUE("object.method_default(10)", QV4::Primitive::fromInt32(19))); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 20); QCOMPARE(o->actuals().count(), 2); @@ -2777,7 +2777,7 @@ void tst_qqmlecmascript::callQtInvokables() QCOMPARE(o->actuals().at(1), QVariant(19)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_default(10, 13)", QV4::Value::fromInt32(13))); + QVERIFY(EVALUATE_VALUE("object.method_default(10, 13)", QV4::Primitive::fromInt32(13))); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 20); QCOMPARE(o->actuals().count(), 2); @@ -2785,14 +2785,14 @@ void tst_qqmlecmascript::callQtInvokables() QCOMPARE(o->actuals().at(1), QVariant(13)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_inherited(9)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_inherited(9)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), -3); QCOMPARE(o->actuals().count(), 1); QCOMPARE(o->actuals().at(0), QVariant(9)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QVariant(9)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QVariant(9)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 21); QCOMPARE(o->actuals().count(), 2); @@ -2800,7 +2800,7 @@ void tst_qqmlecmascript::callQtInvokables() QCOMPARE(o->actuals().at(1), QVariant()); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QVariant(\"Hello\", \"World\")", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QVariant(\"Hello\", \"World\")", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 21); QCOMPARE(o->actuals().count(), 2); @@ -2808,91 +2808,91 @@ void tst_qqmlecmascript::callQtInvokables() QCOMPARE(o->actuals().at(1), QVariant(QString("World"))); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QJsonObject({foo:123})", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QJsonObject({foo:123})", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 22); QCOMPARE(o->actuals().count(), 1); QCOMPARE(qvariant_cast<QJsonObject>(o->actuals().at(0)), QJsonDocument::fromJson("{\"foo\":123}").object()); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QJsonArray([123])", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QJsonArray([123])", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 23); QCOMPARE(o->actuals().count(), 1); QCOMPARE(qvariant_cast<QJsonArray>(o->actuals().at(0)), QJsonDocument::fromJson("[123]").array()); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QJsonValue(123)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QJsonValue(123)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 24); QCOMPARE(o->actuals().count(), 1); QCOMPARE(qvariant_cast<QJsonValue>(o->actuals().at(0)), QJsonValue(123)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QJsonValue(42.35)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QJsonValue(42.35)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 24); QCOMPARE(o->actuals().count(), 1); QCOMPARE(qvariant_cast<QJsonValue>(o->actuals().at(0)), QJsonValue(42.35)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QJsonValue('ciao')", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QJsonValue('ciao')", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 24); QCOMPARE(o->actuals().count(), 1); QCOMPARE(qvariant_cast<QJsonValue>(o->actuals().at(0)), QJsonValue(QStringLiteral("ciao"))); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QJsonValue(true)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QJsonValue(true)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 24); QCOMPARE(o->actuals().count(), 1); QCOMPARE(qvariant_cast<QJsonValue>(o->actuals().at(0)), QJsonValue(true)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QJsonValue(false)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QJsonValue(false)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 24); QCOMPARE(o->actuals().count(), 1); QCOMPARE(qvariant_cast<QJsonValue>(o->actuals().at(0)), QJsonValue(false)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QJsonValue(null)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QJsonValue(null)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 24); QCOMPARE(o->actuals().count(), 1); QCOMPARE(qvariant_cast<QJsonValue>(o->actuals().at(0)), QJsonValue(QJsonValue::Null)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_QJsonValue(undefined)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_QJsonValue(undefined)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 24); QCOMPARE(o->actuals().count(), 1); QCOMPARE(qvariant_cast<QJsonValue>(o->actuals().at(0)), QJsonValue(QJsonValue::Undefined)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_overload({foo:123})", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_overload({foo:123})", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 25); QCOMPARE(o->actuals().count(), 1); QCOMPARE(qvariant_cast<QJsonObject>(o->actuals().at(0)), QJsonDocument::fromJson("{\"foo\":123}").object()); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_overload([123])", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_overload([123])", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 26); QCOMPARE(o->actuals().count(), 1); QCOMPARE(qvariant_cast<QJsonArray>(o->actuals().at(0)), QJsonDocument::fromJson("[123]").array()); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_overload(null)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_overload(null)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 27); QCOMPARE(o->actuals().count(), 1); QCOMPARE(qvariant_cast<QJsonValue>(o->actuals().at(0)), QJsonValue(QJsonValue::Null)); o->reset(); - QVERIFY(EVALUATE_VALUE("object.method_overload(undefined)", QV4::Value::undefinedValue())); + QVERIFY(EVALUATE_VALUE("object.method_overload(undefined)", QV4::Primitive::undefinedValue())); QCOMPARE(o->error(), false); QCOMPARE(o->invoked(), 27); QCOMPARE(o->actuals().count(), 1); |