Skip to content

Commit

Permalink
drivertest_uart: The string was not truncated because one more charac…
Browse files Browse the repository at this point in the history
…ter was read

    #0 0x43c7443a in strnlen nuttx/libs/libc/string/lib_strnlen.c:42
    open-vela#1 0x43c698aa in vsprintf_internal nuttx/libs/libc/stdio/lib_libvsprintf.c:933
    open-vela#2 0x43c6ca80 in lib_vsprintf nuttx/libs/libc/stdio/lib_libvsprintf.c:1383
    open-vela#3 0x4409c0bd in vsnprintf nuttx/libs/libc/stdio/lib_vsnprintf.c:72
    open-vela#4 0x47137cd0 in vcmocka_print_error apps/testing/cmocka/cmocka/src/cmocka.c:2097
    open-vela#5 0x47139573 in cmocka_print_error apps/testing/cmocka/cmocka/src/cmocka.c:2422
    open-vela#6 0x471376ff in string_equal_display_error apps/testing/cmocka/cmocka/src/cmocka.c:1410
    open-vela#7 0x471379a0 in _assert_string_equal apps/testing/cmocka/cmocka/src/cmocka.c:1952
    open-vela#8 0x4433d972 in read_default apps/testing/drivertest/drivertest_uart.c:242
    open-vela#9 0x4713c6cd in cmocka_run_one_test_or_fixture apps/testing/cmocka/cmocka/src/cmocka.c:3029
    open-vela#10 0x4713d487 in cmocka_run_one_tests apps/testing/cmocka/cmocka/src/cmocka.c:3143
    open-vela#11 0x4713f2ca in _cmocka_run_group_tests apps/testing/cmocka/cmocka/src/cmocka.c:3294
    open-vela#12 0x443444c6 in cmocka_driver_uart_main apps/testing/drivertest/drivertest_uart.c:358
    open-vela#13 0x4409a472 in nxtask_startup nuttx/libs/libc/sched/task_startup.c:72
    open-vela#14 0x43dc92e7 in nxtask_start nuttx/sched/task/task_start.c:116
    open-vela#15 0x43e31f00 in pre_start nuttx/arch/sim/src/sim/sim_initialstate.c:52

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
  • Loading branch information
Zhangshoukui committed Dec 27, 2024
1 parent 5bdffb0 commit 00237eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion testing/drivertest/drivertest_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ static void read_default(FAR void **state)

while (cnt < sizeof(DEFAULT_CONTENT) - 1)
{
ssize_t n = read(test_state->fd, buffer + cnt, buffer_size - cnt);
ssize_t n = read(test_state->fd, buffer + cnt, buffer_size - cnt - 1);

assert_true(n >= 0);
if (n == 0)
Expand Down

0 comments on commit 00237eb

Please sign in to comment.