llvm.org GIT mirror llvm / 247f1c6
Python compat - test if type is integral Rely on numbers.Integral instead of int/long Differential Revision: https://reviews.llvm.org/D56262 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350316 91177308-0d34-0410-b5e6-96231b3b80d8 Serge Guelton 8 months ago
1 changed file(s) with 9 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
0 from numbers import Integral
1
2 from .base import TestBase
13 from ..object import ObjectFile
24 from ..object import Relocation
1921 count += 1
2022 assert isinstance(section, Section)
2123 assert isinstance(section.name, str)
22 assert isinstance(section.size, long)
24 assert isinstance(section.size, Integral)
2325 assert isinstance(section.contents, str)
24 assert isinstance(section.address, long)
26 assert isinstance(section.address, Integral)
2527 assert len(section.contents) == section.size
2628
2729 self.assertGreater(count, 0)
3739 count += 1
3840 assert isinstance(symbol, Symbol)
3941 assert isinstance(symbol.name, str)
40 assert isinstance(symbol.address, long)
41 assert isinstance(symbol.size, long)
42 assert isinstance(symbol.address, Integral)
43 assert isinstance(symbol.size, Integral)
4244
4345 self.assertGreater(count, 0)
4446
5961 for section in o.get_sections():
6062 for relocation in section.get_relocations():
6163 assert isinstance(relocation, Relocation)
62 assert isinstance(relocation.address, long)
63 assert isinstance(relocation.offset, long)
64 assert isinstance(relocation.type_number, long)
64 assert isinstance(relocation.address, Integral)
65 assert isinstance(relocation.offset, Integral)
66 assert isinstance(relocation.type_number, Integral)
6567 assert isinstance(relocation.type_name, str)
6668 assert isinstance(relocation.value_string, str)