# HG changeset patch # User Thinker K.F. Li # Date 1312628840 -28800 # Node ID 6e4b6414789bcf8e5b73d1461eb41ca619cc3018 # Parent 7644cb633d4b6537e2d36ff71d6d0726d03230c2 Call _install_dexfile_4_deptracker() to make sure testcase right diff -r 7644cb633d4b -r 6e4b6414789b paraspace/tests/dexfile_test.py --- a/paraspace/tests/dexfile_test.py Sat Aug 06 08:49:30 2011 +0800 +++ b/paraspace/tests/dexfile_test.py Sat Aug 06 19:07:20 2011 +0800 @@ -27,6 +27,8 @@ def dependencies_test(): from paraspace import dex_deptracker + _install_dexfile_4_deptracker() + deps = dex_deptracker.collect_all_dep_decls() assert deps['_DEX_AnnotationItem.typeIdx'][0] == dexfile.depend_idx assert deps['_DEX_AnnotationItem.typeIdx'][1] == 'DEXFile.typeIds' @@ -44,7 +46,7 @@ def resolve_name_path_test(): from paraspace.dex_deptracker import _resolve_name_path - + obj, parent = _resolve_name_path('_DEX_ClassData.staticFields.items') assert obj == list obj, parent = _resolve_name_path('_DEX_ClassData.staticFields.items.*') @@ -68,6 +70,8 @@ def find_dep_decls_from_clazz_test(): from paraspace.dex_deptracker import _find_dep_decls_from_clazz + + _install_dexfile_4_deptracker() dex_types = dict([(dex_type_name, getattr(dexfile, dex_type_name)) for dex_type_name in dir(dexfile) @@ -86,6 +90,8 @@ def find_dep_decls_from_clazz__array_test(): from paraspace.dex_deptracker import _find_dep_decls_from_clazz + _install_dexfile_4_deptracker() + dex_types = dict([(dex_type_name, getattr(dexfile, dex_type_name)) for dex_type_name in dir(dexfile) if dex_type_name.startswith('_DEX_')]) @@ -103,6 +109,8 @@ def travel_dex_relocatable__array_test(): from paraspace.dex_deptracker import _travel_dex_relocatable + _install_dexfile_4_deptracker() + srcdir = os.path.dirname(__file__) srcroot = os.path.join(srcdir, '..', '..') testdatapath = os.path.join(srcroot, 'data', 'testdata1.dex')