Skip to content

Commit

Permalink
Remove fragile assumption from var properties unit test
Browse files Browse the repository at this point in the history
Previously, the test included some hardcoded property index values
which would break if the layout of an item changed.  This commit
ensures that the index of the properties are looked up dynamically.

Change-Id: I5a499f81a0cb859d89f0972eb7cd645107336bc9
Reviewed-by: Martin Jones <martin.jones@nokia.com>
  • Loading branch information
Chris Adams authored and Qt by Nokia committed Dec 15, 2011
1 parent 8b8b0ba commit 32c6ba2
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -4002,8 +4002,8 @@ void tst_qdeclarativeecmascript::propertyVarInheritance()
v8::HandleScope hs;
// XXX NOTE: this is very implementation dependent. QDVMEMO->vmeProperty() is the only
// public function which can return us a handle to something in the varProperties array.
icoCanaryHandle = qPersistentNew(icovmemo->vmeProperty(41));
ccoCanaryHandle = qPersistentNew(ccovmemo->vmeProperty(41));
icoCanaryHandle = qPersistentNew(icovmemo->vmeProperty(ico5->metaObject()->indexOfProperty("circ")));
ccoCanaryHandle = qPersistentNew(ccovmemo->vmeProperty(cco5->metaObject()->indexOfProperty("circ")));
// we make them weak and invoke the gc, but we should not hit the weak-callback yet
// as the varproperties array of each vmemo still references the resource.
icoCanaryHandle.MakeWeak(&propertyVarWeakRefCallbackCount, propertyVarWeakRefCallback);
Expand Down

0 comments on commit 32c6ba2

Please sign in to comment.