Skip to content

Commit

Permalink
Remove another fragile assumption from var prop unit test
Browse files Browse the repository at this point in the history
Commit 32c6ba2 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>
  • Loading branch information
Chris Adams authored and Qt by Nokia committed Dec 19, 2011
1 parent 084487e commit 6859056
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -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");
Expand Down

0 comments on commit 6859056

Please sign in to comment.