本文整理汇总了Python中collector.Collector.enhance_sibling_symbols方法的典型用法代码示例。如果您正苦于以下问题:Python Collector.enhance_sibling_symbols方法的具体用法?Python Collector.enhance_sibling_symbols怎么用?Python Collector.enhance_sibling_symbols使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类collector.Collector
的用法示例。
在下文中一共展示了Collector.enhance_sibling_symbols方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_enhance_sibling_symbols
# 需要导入模块: from collector import Collector [as 别名]
# 或者: from collector.Collector import enhance_sibling_symbols [as 别名]
def test_enhance_sibling_symbols(self):
c = Collector()
aeabi_drsub = {
collector.ADDRESS: "0000009c",
collector.SIZE: 8,
collector.TYPE: collector.TYPE_FUNCTION,
}
aeabi_dsub = {
collector.ADDRESS: "000000a4",
collector.SIZE: 4,
collector.TYPE: collector.TYPE_FUNCTION,
}
adddf3 = {
collector.ADDRESS: "000000a8",
collector.SIZE: 123,
collector.TYPE: collector.TYPE_FUNCTION,
}
c.symbols = {int(f[collector.ADDRESS], 16): f for f in [aeabi_drsub, aeabi_dsub, adddf3]}
c.enhance_sibling_symbols()
self.assertFalse(aeabi_drsub.has_key(collector.PREV_FUNCTION))
self.assertEqual(aeabi_dsub, aeabi_drsub.get(collector.NEXT_FUNCTION))
self.assertEqual(aeabi_drsub, aeabi_dsub.get(collector.PREV_FUNCTION))
self.assertEqual(adddf3, aeabi_dsub.get(collector.NEXT_FUNCTION))
self.assertEqual(aeabi_dsub, adddf3.get(collector.PREV_FUNCTION))
self.assertFalse(adddf3.has_key(collector.NEXT_FUNCTION))