summaryrefslogtreecommitdiff
path: root/tests/extmod/framebuf1.py
diff options
context:
space:
mode:
authorDuncan Lowther <Duncan.Lowther@glasgow.ac.uk>2023-06-15 09:33:10 +0100
committerDuncan Lowther <Duncan.Lowther@glasgow.ac.uk>2023-06-21 09:49:03 +0100
commit41c91422f083aaf61036c8ead26bf0c43111ae00 (patch)
tree4d535df1d3ad09232852c29da9be383a5e47eda4 /tests/extmod/framebuf1.py
parentbc2ed8c55a69d80ea6aa8441673232a8c4054f13 (diff)
tests/extmod/framebuf: Fix buffer size issues.
Tests framebuf1 and framebuf2 do not take the need for byte-aligned strides into consideration when calculating buffer lengths. Accordingly, the buffers allocated are slightly too small. Fixed buffer length calculations. Signed-off-by: Duncan Lowther <Duncan.Lowther@glasgow.ac.uk>
Diffstat (limited to 'tests/extmod/framebuf1.py')
-rw-r--r--tests/extmod/framebuf1.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/extmod/framebuf1.py b/tests/extmod/framebuf1.py
index c8e013226..d35674a70 100644
--- a/tests/extmod/framebuf1.py
+++ b/tests/extmod/framebuf1.py
@@ -6,7 +6,7 @@ except ImportError:
w = 5
h = 16
-size = w * h // 8
+size = ((w + 7) & ~7) * ((h + 7) & ~7) // 8
buf = bytearray(size)
maps = {
framebuf.MONO_VLSB: "MONO_VLSB",