Skip to content

Commit f0c6168

Browse files
Thalleyjhedberg
authored andcommitted
tests: Bluetooth: CAP: Update unicast audio start unittests
Update the CAP initiator audio start unittest. The reason for this, is that the recent change to endpoints means that we need to properly generate a BAP unicast group and call bt_bap_stream_config, instead of trying to manage the bap_iso values directly. As part of updating this, the tests were also updated to significantly reduce code duplication, but generating a default start param that can easily be reused. Signed-off-by: Emil Gydesen <[email protected]>
1 parent 5d8170b commit f0c6168

File tree

3 files changed

+340
-237
lines changed

3 files changed

+340
-237
lines changed

tests/bluetooth/audio/cap_initiator/src/test_common.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ void test_unicast_set_state(struct bt_cap_stream *cap_stream, struct bt_conn *co
4848
enum bt_bap_ep_state state)
4949
{
5050
struct bt_bap_stream *bap_stream = &cap_stream->bap_stream;
51+
int err;
5152

5253
printk("Setting stream %p to state %d\n", bap_stream, state);
5354

@@ -60,6 +61,9 @@ void test_unicast_set_state(struct bt_cap_stream *cap_stream, struct bt_conn *co
6061
zassert_not_null(ep);
6162
zassert_not_null(preset);
6263

64+
err = bt_bap_stream_config(conn, &cap_stream->bap_stream, ep, &preset->codec_cfg);
65+
zassert_equal(err, 0, "Unexpected return value %d", err);
66+
6367
bap_stream->conn = conn;
6468
bap_stream->ep = ep;
6569
bap_stream->qos = &preset->qos;

0 commit comments

Comments
 (0)