-
Notifications
You must be signed in to change notification settings - Fork 349
cmocka: mux_copy and demux_copy: Fix comp_check_eos() checking #10239
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
Conversation
After comp_check_eos() checks were added mux_copy and demux_copy started crashing. Add dummy pipeline with expect_eos = false to bypass the tests. Fixes: d472d22 ("component: Add eos support in components copy function") Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes test crashes in mux_copy and demux_copy tests that occurred after EOS (End of Stream) checking was added to component copy functions. The fix creates dummy pipeline structures with expect_eos = false to bypass the problematic EOS checks during testing.
- Adds dummy pipeline initialization in test setup functions
- Ensures proper cleanup of allocated pipeline structures in teardown functions
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/cmocka/src/audio/mux/mux_copy.c | Adds dummy pipeline setup and cleanup to fix mux copy test crashes |
| test/cmocka/src/audio/mux/demux_copy.c | Adds dummy pipeline setup and cleanup to fix demux copy test crashes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| /* Add dummy pipeline to bypass comp_check_eos() */ | ||
| dummy_pipe = test_malloc(sizeof(*dummy_pipe)); | ||
| if (!dummy_pipe) | ||
| return -ENOMEM; | ||
| dummy_pipe->expect_eos = false; | ||
| dev->pipeline = dummy_pipe; |
Copilot
AI
Sep 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dummy pipeline is only partially initialized. Consider using memset or calloc to zero-initialize the entire structure to avoid potential issues with uninitialized fields.
| /* Add dummy pipeline to bypass comp_check_eos() */ | ||
| dummy_pipe = test_malloc(sizeof(*dummy_pipe)); | ||
| if (!dummy_pipe) | ||
| return -ENOMEM; | ||
| dummy_pipe->expect_eos = false; | ||
| dev->pipeline = dummy_pipe; |
Copilot
AI
Sep 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dummy pipeline is only partially initialized. Consider using memset or calloc to zero-initialize the entire structure to avoid potential issues with uninitialized fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the failing cmocka test https://github.com/thesofproject/sof/actions/runs/17617615782/job/50054789968 after merging #10143 which this PR fixes
kv2019i
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jsarha !
singalsu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works, thanks!
softwarecki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ugh. How that PR get through CI test? Sorry for introducing a defect.
After comp_check_eos() checks were added mux_copy and demux_copy started crashing. Add dummy pipeline with expect_eos = false to bypass the tests.
Fixes: d472d22 ("component: Add eos support in components copy function")