--- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp Mon Jun 21 22:38:13 2010 +0100
+++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp Thu Jul 22 16:41:55 2010 +0100
@@ -1446,9 +1446,11 @@
QScriptValue undefined = eng.undefinedValue();
QCOMPARE(undefined.toObject().isValid(), false);
+ QVERIFY(undefined.isUndefined());
QScriptValue null = eng.nullValue();
QCOMPARE(null.toObject().isValid(), false);
+ QVERIFY(null.isNull());
{
QScriptValue falskt = QScriptValue(&eng, false);
@@ -1457,6 +1459,7 @@
QCOMPARE(tmp.isObject(), true);
QCOMPARE(tmp.toNumber(), falskt.toNumber());
}
+ QVERIFY(falskt.isBool());
QScriptValue sant = QScriptValue(&eng, true);
{
@@ -1464,6 +1467,7 @@
QCOMPARE(tmp.isObject(), true);
QCOMPARE(tmp.toNumber(), sant.toNumber());
}
+ QVERIFY(sant.isBool());
QScriptValue number = QScriptValue(&eng, 123.0);
{
@@ -1471,6 +1475,7 @@
QCOMPARE(tmp.isObject(), true);
QCOMPARE(tmp.toNumber(), number.toNumber());
}
+ QVERIFY(number.isNumber());
QScriptValue str = QScriptValue(&eng, QString("ciao"));
{
@@ -1478,6 +1483,7 @@
QCOMPARE(tmp.isObject(), true);
QCOMPARE(tmp.toString(), str.toString());
}
+ QVERIFY(str.isString());
}
QScriptValue object = eng.newObject();
@@ -1497,10 +1503,12 @@
QScriptValue undefined = QScriptValue(QScriptValue::UndefinedValue);
QVERIFY(!undefined.toObject().isValid());
QVERIFY(!eng.toObject(undefined).isValid());
+ QVERIFY(undefined.isUndefined());
QScriptValue null = QScriptValue(QScriptValue::NullValue);
QVERIFY(!null.toObject().isValid());
QVERIFY(!eng.toObject(null).isValid());
+ QVERIFY(null.isNull());
QScriptValue falskt = QScriptValue(false);
QVERIFY(!falskt.toObject().isValid());
@@ -1509,6 +1517,7 @@
QVERIFY(tmp.isObject());
QVERIFY(tmp.toBool());
}
+ QVERIFY(falskt.isBool());
QScriptValue sant = QScriptValue(true);
QVERIFY(!sant.toObject().isValid());
@@ -1517,6 +1526,7 @@
QVERIFY(tmp.isObject());
QVERIFY(tmp.toBool());
}
+ QVERIFY(sant.isBool());
QScriptValue number = QScriptValue(123.0);
QVERIFY(!number.toObject().isValid());
@@ -1525,6 +1535,7 @@
QVERIFY(tmp.isObject());
QCOMPARE(tmp.toInt32(), number.toInt32());
}
+ QVERIFY(number.isNumber());
QScriptValue str = QScriptValue(QString::fromLatin1("ciao"));
QVERIFY(!str.toObject().isValid());
@@ -1533,6 +1544,7 @@
QVERIFY(tmp.isObject());
QCOMPARE(tmp.toString(), QString::fromLatin1("ciao"));
}
+ QVERIFY(str.isString());
}
}
@@ -2047,7 +2059,9 @@
}
// should still be deletable from C++
object.setProperty("undeletableProperty", QScriptValue());
+ QEXPECT_FAIL("", "With JSC-based back-end, undeletable properties can't be deleted from C++", Continue);
QVERIFY(!object.property("undeletableProperty").isValid());
+ QEXPECT_FAIL("", "With JSC-based back-end, undeletable properties can't be deleted from C++", Continue);
QCOMPARE(object.propertyFlags("undeletableProperty"), 0);
// SkipInEnumeration
@@ -2082,11 +2096,11 @@
object.setProperty("flagProperty", str, QScriptValue::ReadOnly);
QCOMPARE(object.propertyFlags("flagProperty"), QScriptValue::ReadOnly);
- object.setProperty("flagProperty", str, object.propertyFlags("flagProperty") | QScriptValue::Undeletable);
- QCOMPARE(object.propertyFlags("flagProperty"), QScriptValue::ReadOnly | QScriptValue::Undeletable);
+ object.setProperty("flagProperty", str, object.propertyFlags("flagProperty") | QScriptValue::SkipInEnumeration);
+ QCOMPARE(object.propertyFlags("flagProperty"), QScriptValue::ReadOnly | QScriptValue::SkipInEnumeration);
object.setProperty("flagProperty", str, QScriptValue::KeepExistingFlags);
- QCOMPARE(object.propertyFlags("flagProperty"), QScriptValue::ReadOnly | QScriptValue::Undeletable);
+ QCOMPARE(object.propertyFlags("flagProperty"), QScriptValue::ReadOnly | QScriptValue::SkipInEnumeration);
object.setProperty("flagProperty", str, QScriptValue::UserRange);
QCOMPARE(object.propertyFlags("flagProperty"), QScriptValue::UserRange);