Skip to content

Conversation

Thalley
Copy link
Contributor

@Thalley Thalley commented Jun 6, 2025

Adds unittests for the handover from unicast to broadcast APIs.

@Thalley Thalley changed the title Cap handover broadcast to unicast unittests tests: Bluetooth: CAP: Handover u->b unittests Jun 6, 2025
@Thalley Thalley force-pushed the cap_handover_broadcast_to_unicast_unittests branch 9 times, most recently from 25a78fd to d07b671 Compare June 19, 2025 12:50
@Thalley Thalley force-pushed the cap_handover_broadcast_to_unicast_unittests branch from d07b671 to 9fda4b4 Compare July 1, 2025 12:25
@Thalley Thalley force-pushed the cap_handover_broadcast_to_unicast_unittests branch 2 times, most recently from 8f1e6bf to e47f68c Compare July 31, 2025 15:17
@Thalley Thalley force-pushed the cap_handover_broadcast_to_unicast_unittests branch 5 times, most recently from 417bbad to d6a1b93 Compare August 12, 2025 07:58
@Thalley Thalley force-pushed the cap_handover_broadcast_to_unicast_unittests branch 2 times, most recently from 7f1b407 to 6f80c10 Compare August 15, 2025 08:32
@Thalley
Copy link
Contributor Author

Thalley commented Aug 17, 2025

depends on #91514

@Thalley Thalley force-pushed the cap_handover_broadcast_to_unicast_unittests branch from 6f80c10 to 2c48e63 Compare August 19, 2025 12:24
@Thalley Thalley marked this pull request as ready for review August 19, 2025 12:24
@Thalley Thalley force-pushed the cap_handover_broadcast_to_unicast_unittests branch 3 times, most recently from 563398e to 3143f6c Compare September 8, 2025 09:04
@Thalley Thalley force-pushed the cap_handover_broadcast_to_unicast_unittests branch 4 times, most recently from b7ef02f to 10d5ef8 Compare September 9, 2025 12:45
@Thalley Thalley requested a review from Copilot September 12, 2025 12:14
Copy link

@Copilot Copilot AI left a 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 adds unit tests for the CAP (Common Audio Profile) handover functionality, specifically testing the handover from unicast to broadcast APIs. The tests verify the CAP handover implementation with comprehensive coverage of valid operations and error conditions.

  • Implements comprehensive unit tests for unicast-to-broadcast CAP handover functionality
  • Adds mock implementations for Bluetooth audio components including unicast client, broadcast assistant, and advertising
  • Creates test infrastructure with fixtures, setup/teardown procedures, and validation utilities

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/bluetooth/audio/mocks/src/adv.c New mock implementation for Bluetooth LE extended advertising functions
tests/bluetooth/audio/mocks/include/bluetooth.h Extended mock header with advertising state enums
tests/bluetooth/audio/mocks/CMakeLists.txt Added new advertising mock to build
tests/bluetooth/audio/cap_handover/uut/*.c Mock implementations for CSIP, CAP initiator, handover, unicast client, and broadcast assistant
tests/bluetooth/audio/cap_handover/src/*.c Unit test implementation and common test utilities
tests/bluetooth/audio/cap_handover/.yaml/.conf/*.txt Test configuration and build files
subsys/bluetooth/audio/bap_broadcast_assistant.c Removed unused device.h include

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Thalley Thalley force-pushed the cap_handover_broadcast_to_unicast_unittests branch from 10d5ef8 to 309b3ea Compare September 12, 2025 12:37
@Thalley Thalley requested a review from Copilot September 12, 2025 12:37
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

}

/* If the stream can be disconnected, BAP will disconnect the stream once it reaches the
* QoS Configured state. We simulator that behavior here, and if the stream is disconnected,
Copy link

Copilot AI Sep 12, 2025

Choose a reason for hiding this comment

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

Typo in comment: 'simulator' should be 'simulate'.

Suggested change
* QoS Configured state. We simulator that behavior here, and if the stream is disconnected,
* QoS Configured state. We simulate that behavior here, and if the stream is disconnected,

Copilot uses AI. Check for mistakes.

@Thalley Thalley force-pushed the cap_handover_broadcast_to_unicast_unittests branch from 309b3ea to 52ff03c Compare September 12, 2025 12:46
@Thalley Thalley requested a review from Copilot September 12, 2025 12:46
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

int err = 0;

/* Attempt to use a stream with invalid unicast group */
fixture->broadcast_stream_params[0].stream->bap_stream.group = UINT_TO_POINTER(0x12345678);
Copy link

Copilot AI Sep 12, 2025

Choose a reason for hiding this comment

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

The magic number 0x12345678 should be defined as a named constant to improve code readability and maintainability.

Copilot uses AI. Check for mistakes.

@Thalley Thalley force-pushed the cap_handover_broadcast_to_unicast_unittests branch 2 times, most recently from 37ea934 to 6dfff71 Compare September 17, 2025 09:22
@Thalley Thalley force-pushed the cap_handover_broadcast_to_unicast_unittests branch from 6dfff71 to 2560884 Compare September 30, 2025 08:37
@zephyrbot zephyrbot added the area: Tests Issues related to a particular existing or missing test label Sep 30, 2025
@zephyrbot zephyrbot requested a review from nashif September 30, 2025 08:41
Adds unittests for the handover from unicast to broadcast
APIs.

Signed-off-by: Emil Gydesen <[email protected]>
@Thalley Thalley force-pushed the cap_handover_broadcast_to_unicast_unittests branch from 2560884 to 03410b6 Compare October 13, 2025 12:07
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Bluetooth Audio area: Bluetooth area: Tests Issues related to a particular existing or missing test

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

2 participants