Skip to content

tests: drivers: spi_loopback: Fix NULL rx buff testcase #90626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

raffarost
Copy link
Collaborator

Fixes setup of TX buffer, which shouldn't be NULL in the RX NULL tescase.

Fixes setup of TX buffer, which shouldn't be NULL in the RX NULL
tescase.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
@github-actions github-actions bot added size: XS A PR changing only a single line of code area: SPI SPI bus labels May 26, 2025
@github-actions github-actions bot requested review from tbursztyka and teburd May 26, 2025 19:42
@raffarost raffarost requested a review from sylvioalves May 26, 2025 19:42
@sylvioalves sylvioalves requested a review from nordic-piks May 26, 2025 19:48
Copy link

@nordic-piks
Copy link
Collaborator

@nordic-pikr FYI

Copy link
Contributor

@nordic-pikr nordic-pikr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raffarost please have a look 89168

@raffarost
Copy link
Collaborator Author

@raffarost please have a look 89168

hi @nordic-pikr
Shouldn't the testcase be modified as well? Effectively we see a NULL pointer for both TX and RX inside the driver, which is a different condition (but should be managed by the driver, as you mentioned).

@nordic-pikr
Copy link
Contributor

@raffarost please have a look 89168

hi @nordic-pikr Shouldn't the testcase be modified as well? Effectively we see a NULL pointer for both TX and RX inside the driver, which is a different condition (but should be managed by the driver, as you mentioned).

Ok, you're right. What would you say to adding another one test case, with spi_loopback_transceive(spec, NULL, NULL); ?

@raffarost
Copy link
Collaborator Author

@raffarost please have a look 89168

hi @nordic-pikr Shouldn't the testcase be modified as well? Effectively we see a NULL pointer for both TX and RX inside the driver, which is a different condition (but should be managed by the driver, as you mentioned).

Ok, you're right. What would you say to adding another one test case, with spi_loopback_transceive(spec, NULL, NULL); ?

When spi_context_buffers_setup() is called, this condition is converted into the test_nop_nil_bufs testcase (internal buffers are replaced by NULL), so I guess it is already covered by that one.

@nordic-pikr
Copy link
Contributor

nordic-pikr commented May 27, 2025

@raffarost please have a look 89168

hi @nordic-pikr Shouldn't the testcase be modified as well? Effectively we see a NULL pointer for both TX and RX inside the driver, which is a different condition (but should be managed by the driver, as you mentioned).

Ok, you're right. What would you say to adding another one test case, with spi_loopback_transceive(spec, NULL, NULL); ?

When spi_context_buffers_setup() is called, this condition is converted into the test_nop_nil_bufs testcase (internal buffers are replaced by NULL), so I guess it is already covered by that one.

Is it covered by test_nop_nil_bufs? In this case spi_transceive_dt will get two spi_buf_set type pointers and I propose pass NULL instead. It is not exactly the same, right? @tbursztyka, @teburd any opinion on that? Let's move this discussion to 90699 as is not related to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: SPI SPI bus size: XS A PR changing only a single line of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants