From: Chris Adams Date: Fri, 16 Dec 2011 00:58:20 +0000 (+1000) Subject: Remove another fragile assumption from var prop unit test X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=6859056a0924b3da52b045aa14a34fae59a5c75e;p=konrad%2Fqtdeclarative.git 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 --- diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 9bb763c..10ae0cc 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(), rootObject); QCOMPARE(childObject->property("textCanary").toInt(), 10); } QMetaObject::invokeMethod(object, "deassignCircular");