zephyr/tests/drivers/uart/uart_async_api
Andriy Gelman 6db785404a tests: drivers: uart_async_api: Be more robust to early buf release
Commit eb44414af9 modified
test_single_read for early rx buf release.

The commit assumed that tdata.last_rx_buf points to either &tdata.rx_buf[0]
if the driver releases the first buffer or at &rx_buf[5] if the first
buffer is not released. However, where tdata.last_rx_buf points to depends
on the timeout given to uart_rx_enable(), making the test flaky.

This commit modifies the test by keeping track how many bytes have been
received in the first and second buffers.
The function tdata_check_recv_buffer() validates that the sent data
matches the received bytes which may have been split between first and
second buffer.

This fixes the uart_async_api test on the xmc45_relax_kit.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-11-13 09:41:49 +01:00
..
boards tests: drivers: serial: async: Add support for stm32h735g_disco 2023-11-10 10:41:23 +01:00
src tests: drivers: uart_async_api: Be more robust to early buf release 2023-11-13 09:41:49 +01:00
CMakeLists.txt tests: drivers: uart: Adding wide data async tests 2023-08-30 10:17:17 +02:00
prj.conf tests: remove CONFIG_ZTEST_NEW_API in all tests 2023-10-20 15:04:29 +02:00
testcase.yaml tests: drivers: uart: Adding wide data async tests 2023-08-30 10:17:17 +02:00