-
Notifications
You must be signed in to change notification settings - Fork 8.1k
tests: bluetooth: ascs: make callback expectation checks more generic #97316
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
base: main
Are you sure you want to change the base?
tests: bluetooth: ascs: make callback expectation checks more generic #97316
Conversation
Hello @dkushche, and thank you very much for your first pull request to the Zephyr project! |
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 refactors the ASCS test callback verification functions to use a more generic approach that accepts expected counts and arrays of streams/parameters instead of single values. This improves scalability and reusability across different test scenarios where multiple callbacks or varying numbers of calls need to be verified.
Key changes:
- Replace single-stream callback verification functions with generic array-based versions
- Update function signatures to accept expected count and parameter arrays
- Modify test cases to provide arrays of streams and other parameters
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
File | Description |
---|---|
tests/bluetooth/audio/mocks/include/bap_stream_expects.h | Converted single-instance expectation functions to generic array-based versions supporting multiple streams |
tests/bluetooth/audio/ascs/src/test_ase_state_transition.c | Updated test calls to use new generic expectation functions with stream arrays |
tests/bluetooth/audio/ascs/src/main.c | Updated test calls to use new generic expectation functions with stream arrays |
tests/bluetooth/audio/ascs/include/bap_unicast_server_expects.h | Converted single-instance expectation macros to generic array-based versions supporting multiple streams |
Comments suppressed due to low confidence (1)
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
Overall looks good, and no major/blocking comments from me. There are a few comments I'd like you to consider though
Thanks :)
tests/bluetooth/audio/ascs/include/bap_unicast_server_expects.h
Outdated
Show resolved
Hide resolved
The existing ASCS test callback verification functions scale poorly and are not easily reusable across different cases. This change introduces a more generic approach to expectation checks by adding `expect_bt_bap_unicast_server_cb_release_called(_expected_count, _streams)` and similar functions, improving readability and maintainability of ASCS unit tests. Fixes zephyrproject-rtos#58034 Signed-off-by: Dima Kushchevskyi <[email protected]>
8a0269f
to
67f70d6
Compare
|
The existing ASCS test callback verification functions scale poorly and are not easily reusable across different cases.
This change introduces a more generic approach to expectation checks by adding
expect_bt_bap_unicast_server_cb_release_called(_expected_count, _streams)
and similar functions, improving readability and maintainability of ASCS unit tests.Fixes #58034