changeset 95:9373465643e0

Fix bug of DEXFile_linked.get_classdef_name
author Thinker K.F. Li <thinker@codemud.net>
date Mon, 25 Jul 2011 15:22:03 +0800
parents 88645ab29aeb
children 1769e52bdd9d
files paraspace/dexfile.py paraspace/tests/injection_test.py
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/paraspace/dexfile.py	Mon Jul 25 14:22:08 2011 +0800
+++ b/paraspace/dexfile.py	Mon Jul 25 15:22:03 2011 +0800
@@ -1689,7 +1689,7 @@
     ## \brief Return name string of a linked class definition item
     @staticmethod
     def get_classdef_name(classdef):
-        return classdef.classIdx.descriptorIdx.stringDataOff.data
+        return classdef.classIdx.descriptorIdx.stringDataOff.data.data
     
     def find_class_name(self, name):
         for classdef in self.classDefs.items:
--- a/paraspace/tests/injection_test.py	Mon Jul 25 14:22:08 2011 +0800
+++ b/paraspace/tests/injection_test.py	Mon Jul 25 15:22:03 2011 +0800
@@ -39,7 +39,10 @@
     fakefile_fn = os.path.join(srcroot, 'data', 'fakefile.dex')
     fakefile_dex = dexfile.DEXFile.open(fakefile_fn)
     fakefile_linked = \
-        dexfile.DEXFile_linked.build_dependencies(fakefile_dex,
-                                                  all_dep_decls)
+        dexfile.DEXFile_linked. \
+        build_dependencies(fakefile_dex, all_dep_decls)
+    
+    fakefile_def = fakefile_linked. \
+        find_class_name('Lcom/codemud/fakefile/fakefile;')
     pass