tests/extmod/uctypes_ptr_le: Test int() operation on a pointer field.

This commit is contained in:
Paul Sokolovsky 2018-08-29 19:38:14 +03:00 committed by Damien George
parent 9d864bde04
commit 0de6815ec1
2 changed files with 5 additions and 0 deletions

View File

@ -22,6 +22,9 @@ buf = addr.to_bytes(uctypes.sizeof(desc), "little")
S = uctypes.struct(uctypes.addressof(buf), desc, uctypes.LITTLE_ENDIAN)
print(addr == int(S.ptr))
print(addr == int(S.ptr2))
print(S.ptr[0])
assert S.ptr[0] == ord("0")
print(S.ptr[1])

View File

@ -1,3 +1,5 @@
True
True
48
49
0x3130