aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeecmascript
diff options
context:
space:
mode:
authorChris Adams <christopher.adams@nokia.com>2011-12-16 10:58:20 +1000
committerQt by Nokia <qt-info@nokia.com>2011-12-19 01:13:43 +0100
commit6859056a0924b3da52b045aa14a34fae59a5c75e (patch)
tree7361483611d9403a1b430c80b946209ebfeaea35 /tests/auto/declarative/qdeclarativeecmascript
parent084487ee1f296b806c946a9cf92d184d54ff5d54 (diff)
Remove another fragile assumption from var prop unit test
Commit 32c6ba2c3802bfda11e455c8aaaee41662c237fb removed hardcoded prop indices from one test, but missed another test case which also hardcoded a property index. Change-Id: Iaac863f8176d09077ce1773b642cb88a01cc3fd1 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript')
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
index 9bb763cf7c..10ae0ccd09 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
+++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
@@ -4044,10 +4044,11 @@ void tst_qdeclarativeecmascript::propertyVarInheritance2()
{
v8::HandleScope hs;
propertyVarWeakRefCallbackCount = 0; // reset callback count.
- childObjectVarArrayValueHandle = qPersistentNew(((QDeclarativeVMEMetaObject *)(childObject->metaObject()))->vmeProperty(58));
+ childObjectVarArrayValueHandle = qPersistentNew(((QDeclarativeVMEMetaObject *)(childObject->metaObject()))->vmeProperty(childObject->metaObject()->indexOfProperty("vp")));
childObjectVarArrayValueHandle.MakeWeak(&propertyVarWeakRefCallbackCount, propertyVarWeakRefCallback);
gc(engine);
QVERIFY(propertyVarWeakRefCallbackCount == 0); // should not have been collected yet.
+ QCOMPARE(childObject->property("vp").value<QObject*>(), rootObject);
QCOMPARE(childObject->property("textCanary").toInt(), 10);
}
QMetaObject::invokeMethod(object, "deassignCircular");