comparison paraspace/tests/injection_test.py @ 141:90690a001172

Fixing back to back association and encoding issue. - Fix problem of _deoptimize_classdata() and _optimize_classdata() - They don't deoptimize or optimize field indices for _DEX_ClassData.
author Thinker K.F. Li <thinker@codemud.net>
date Sun, 14 Aug 2011 21:18:48 +0800
parents d4e794249b0f
children 50d09eba5166
comparison
equal deleted inserted replaced
140:d4e794249b0f 141:90690a001172
654 assert methodid in hello_linked.methodIds.items 654 assert methodid in hello_linked.methodIds.items
655 methodidx = hello_linked.get_idx_methodid(methodid) 655 methodidx = hello_linked.get_idx_methodid(methodid)
656 method = hello_linked.find_method_idx(methodidx) 656 method = hello_linked.find_method_idx(methodidx)
657 blk = dexfile.DEXFile_linked.get_code_block_method(method) 657 blk = dexfile.DEXFile_linked.get_code_block_method(method)
658 opvectors = decode_insn_blk(blk) 658 opvectors = decode_insn_blk(blk)
659 print opvectors
660 pass 659 pass
661 pass 660 pass
662 661
663 inject_redir_no_restore(fake_linked, 'Lcom/codemud/fakefile/fakefile;', 662 inject_redir_no_restore(fake_linked, 'Lcom/codemud/fakefile/fakefile;',
664 hello_linked, 'Ljava/io/File;', all_dep_decls) 663 hello_linked, 'Ljava/io/File;', all_dep_decls)
694 assert new_methodid1 is saved_methodid1 693 assert new_methodid1 is saved_methodid1
695 pass 694 pass
696 elif methodname == 'write_file': 695 elif methodname == 'write_file':
697 assert methodid in hello_linked.methodIds.items 696 assert methodid in hello_linked.methodIds.items
698 methodidx = hello_linked.get_idx_methodid(methodid) 697 methodidx = hello_linked.get_idx_methodid(methodid)
699 print dexfile.DEXFile_linked.get_typeid_name(methodid.classIdx)
700 method = hello_linked.find_method_idx(methodidx) 698 method = hello_linked.find_method_idx(methodidx)
701 blk = dexfile.DEXFile_linked.get_code_block_method(method) 699 blk = dexfile.DEXFile_linked.get_code_block_method(method)
702 opvectors = decode_insn_blk(blk) 700 opvectors = decode_insn_blk(blk)
703 print opvectors 701 pass
704 pass 702 pass
705 pass
706 assert False
707 pass 703 pass
708 704
709 705
710 ## \brief Test case for checking methods of classdatas are consistent. 706 ## \brief Test case for checking methods of classdatas are consistent.
711 # 707 #