def test_uint64(self):
if sys.maxsize != (1 << 63)-1:
py.test.skip('64 bit only')
if IS_PYPY and sys.pypy_version_info < (5, 6):
py.test.skip('Broken on PyPy<5.6')
#
buf = struct.pack('Q', sys.maxsize)
val = unpack_primitive(ord('Q'), buf, 0)
assert val == sys.maxsize
assert type(val) is int
#
buf = struct.pack('Q', sys.maxsize+1)
val = unpack_primitive(ord('Q'), buf, 0)
assert val == sys.maxsize+1
if six.PY3:
assert type(val) is int
else:
assert type(val) is long
评论列表
文章目录