changeset 129:52749d91cc22

update index of elements while calling update_offset()
author Thinker K.F. Li <thinker@codemud.net>
date Tue, 09 Aug 2011 00:06:58 +0800
parents b381aa95fbad
children 117047deda64
files paraspace/dex_deptracker.py paraspace/tests/dex_deptracker_test.py
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/paraspace/dex_deptracker.py	Mon Aug 08 22:48:14 2011 +0800
+++ b/paraspace/dex_deptracker.py	Tue Aug 09 00:06:58 2011 +0800
@@ -470,6 +470,9 @@
         pass
 
     def set_marker(self, obj, off):
+        for idx, elt in enumerate(obj.items):
+            elt.data_idx = idx
+            pass
         pass
     pass
 
--- a/paraspace/tests/dex_deptracker_test.py	Mon Aug 08 22:48:14 2011 +0800
+++ b/paraspace/tests/dex_deptracker_test.py	Tue Aug 09 00:06:58 2011 +0800
@@ -57,6 +57,8 @@
     dex.classDatas.items[1].data_offset = 0
     cdoffsetlast = dex.classDatas.items[-1].data_offset
     dex.classDatas.items[-1].data_offset = 0
+
+    dex.typeIds.items[12].data_idx = 0
     
     update_offset(dex, all_dep_decls)
 
@@ -65,6 +67,7 @@
     assert dex.classDatas.items[0].data_offset == cdoffset0
     assert dex.classDatas.items[1].data_offset == cdoffset1
     assert dex.classDatas.items[-1].data_offset == cdoffsetlast
+    assert dex.typeIds.items[12].data_idx == 12
     pass