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

pull/4335/head
Paul Sokolovsky 2018-08-29 19:38:14 +03:00 zatwierdzone przez Damien George
rodzic 9d864bde04
commit 0de6815ec1
2 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -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])

Wyświetl plik

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