Skip to content

Commit

Permalink
tests: Initialize array in pipe test
Browse files Browse the repository at this point in the history
As the pointer to the data buffer passed to k_pipe_put() is now a
'const', that buffer must be initialized before calling k_pipe_put()
to avoid a compiler warning.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
  • Loading branch information
peter-mitsis authored and nashif committed Dec 15, 2023
1 parent 4b2bf5a commit 94829f4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ ZTEST(pipe_api, test_half_pipe_put_get)
size_t rd_byte = 0;
int ret;

memset(rx_data, 0, sizeof(rx_data));

/* TESTPOINT: min_xfer > bytes_to_read */
ret = k_pipe_put(&kpipe, &rx_data[0], 1, &rd_byte, 24, K_NO_WAIT);
zassert_true(ret == -EINVAL);
Expand Down

0 comments on commit 94829f4

Please sign in to comment.