def test_integer_ranges(self):
ffi = FFI(backend=self.Backend())
for (c_type, size) in [('char', 1),
('short', 2),
('short int', 2),
('', 4),
('int', 4),
('long', SIZE_OF_LONG),
('long int', SIZE_OF_LONG),
('long long', 8),
('long long int', 8),
]:
for unsigned in [None, False, True]:
c_decl = {None: '',
False: 'signed ',
True: 'unsigned '}[unsigned] + c_type
if c_decl == 'char' or c_decl == '':
continue
self._test_int_type(ffi, c_decl, size, unsigned)
评论列表
文章目录