circuitpython/tests/micropython/ringio.py.exp
Jeff Epler 0615d13963 py/objringio: 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.

Fixes issue #17847.

Signed-off-by: Jeff Epler <jepler@gmail.com>
2025-08-15 01:21:25 +10: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'>