aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeecmascript
diff options
context:
space:
mode:
authorChris Adams <christopher.adams@nokia.com>2011-12-15 16:03:58 +1000
committerQt by Nokia <qt-info@nokia.com>2011-12-15 08:00:18 +0100
commit32c6ba2c3802bfda11e455c8aaaee41662c237fb (patch)
treeee1218a680285fcfe9c79bc0a6c58a501372815d /tests/auto/declarative/qdeclarativeecmascript
parent8b8b0bac82681e822896107c6ad11e3a18082059 (diff)
Remove fragile assumption from var properties unit test
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>
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript')
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
index 7cddfd22f1..a01c80b7e3 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
+++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
@@ -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);