circuitpython/tests/micropython/ringio.py.exp
Jeff Epler b0175bb2f7 ringio: Detect incorrect constructor calls.
ringbuffer.size must be at least 2, and is a 16-bit quantity.

This fixes several cases including the one the fuzzer discovered,
which would lead to a fatal signal when accessing the object.

Closes: #17847
Signed-off-by: Jeff Epler <jepler@gmail.com>
2025-08-13 08:39:52 -05:00

19 lines
283 B
Text

<RingIO>
0
1
2
b'\x00\x00'
0
b'\x00\x01'
b''
16
0
b'\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01'
<RingIO>
16
0
b'\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01'
<class 'TypeError'>
<class 'ValueError'>
<class 'ValueError'>
<class 'ValueError'>