esp-idf/components/esp_ringbuf/test
Sudeep Mohanty 9e46667545 ringbuf: Fix bug where comparision between a signed and unsigned operand resulted in incorrect free size for no-split/allow-split buffers
This commit fixes a bug in no-split and allow-split ring buffers free buffer size calculation.
When the free size available in the buffers less than the size of one item header,
the function prvGetCurMaxSizeNoSplit/AllowSplit() incorrectly returned the maxItemSize instead of 0.
This is due to the comparision between a negative and a positive value
where both operands are treated as unsigned during the comparision operation,
thereby treating the negative operand as a large integer.

Also added new unit tests to test buffer-full and almost-full conditions
where this scenario is likely to be hit.

Closes https://github.com/espressif/esp-idf/issues/7344
Closes https://github.com/espressif/esp-idf/pull/7371
2021-11-10 14:42:40 +05:30
..
CMakeLists.txt esp32: cleanup build script 2021-07-16 20:14:27 +08:00
component.mk esp_ringbuf: move ringbuf to seperate component 2018-09-17 17:04:57 +05:30
test_ringbuf.c ringbuf: Fix bug where comparision between a signed and unsigned operand resulted in incorrect free size for no-split/allow-split buffers 2021-11-10 14:42:40 +05:30