tests/basics: Add memoryview test for big ints.

This commit is contained in:
Damien George 2017-05-09 10:49:19 +10:00
parent 2e9e14980d
commit e711e2d44a
2 changed files with 11 additions and 4 deletions

View File

@ -12,7 +12,3 @@ print(list(memoryview(array('b', [0x7f, -0x80]))))
print(list(memoryview(array('B', [0x7f, 0x80, 0x81, 0xff])))) print(list(memoryview(array('B', [0x7f, 0x80, 0x81, 0xff]))))
print(list(memoryview(array('h', [0x7f00, -0x8000])))) print(list(memoryview(array('h', [0x7f00, -0x8000]))))
print(list(memoryview(array('H', [0x7f00, 0x8000, 0x8100, 0xffff])))) print(list(memoryview(array('H', [0x7f00, 0x8000, 0x8100, 0xffff]))))
# these constructors give an internal overflow in uPy
#print(list(memoryview(array('i', [0x7f000000, -0x80000000]))))
#print(list(memoryview(array('I', [0x7f000000, 0x80000000, 0x81000000, 0xffffffff]))))

View File

@ -0,0 +1,11 @@
# test memoryview accessing maximum values for signed/unsigned elements
try:
from array import array
memoryview
except:
import sys
print("SKIP")
sys.exit()
print(list(memoryview(array('i', [0x7f000000, -0x80000000]))))
print(list(memoryview(array('I', [0x7f000000, 0x80000000, 0x81000000, 0xffffffff]))))