aboutsummaryrefslogtreecommitdiff
path: root/tests/extmod
diff options
context:
space:
mode:
Diffstat (limited to 'tests/extmod')
-rw-r--r--tests/extmod/uctypes_ptr_le.py2
-rw-r--r--tests/extmod/uctypes_ptr_native_le.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/extmod/uctypes_ptr_le.py b/tests/extmod/uctypes_ptr_le.py
index ef9890c3f..4125dd86f 100644
--- a/tests/extmod/uctypes_ptr_le.py
+++ b/tests/extmod/uctypes_ptr_le.py
@@ -9,7 +9,7 @@ desc = {
bytes = b"01"
addr = uctypes.addressof(bytes)
-buf = addr.to_bytes(4)
+buf = addr.to_bytes(uctypes.sizeof(desc))
S = uctypes.struct(desc, uctypes.addressof(buf), uctypes.LITTLE_ENDIAN)
diff --git a/tests/extmod/uctypes_ptr_native_le.py b/tests/extmod/uctypes_ptr_native_le.py
index 139ed3280..ba06b2650 100644
--- a/tests/extmod/uctypes_ptr_native_le.py
+++ b/tests/extmod/uctypes_ptr_native_le.py
@@ -15,7 +15,7 @@ desc = {
bytes = b"01"
addr = uctypes.addressof(bytes)
-buf = addr.to_bytes(4)
+buf = addr.to_bytes(uctypes.sizeof(desc))
S = uctypes.struct(desc, uctypes.addressof(buf), uctypes.NATIVE)