Skip to content

Commit c7476fd

Browse files
MariuszSkamracarlescufi
authored andcommitted
tests: Bluetooth: ascs: Get chan pointer from test_preamble_state_disabling
This adds a possibility to get the ISO channel pointer from test_preamble_state_disabling function that can be further used in tests. Signed-off-by: Mariusz Skamra <[email protected]>
1 parent e85a0bc commit c7476fd

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

tests/bluetooth/audio/ascs/include/test_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ void test_preamble_state_streaming(struct bt_conn *conn, uint8_t ase_id,
6565
struct bt_bap_stream *stream, struct bt_iso_chan **chan,
6666
bool source);
6767
void test_preamble_state_disabling(struct bt_conn *conn, uint8_t ase_id,
68-
struct bt_bap_stream *stream);
68+
struct bt_bap_stream *stream, struct bt_iso_chan **chan);

tests/bluetooth/audio/ascs/src/test_ase_control_params.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,8 +830,9 @@ static void test_receiver_stop_ready_expect_invalid_length(struct bt_conn *conn,
830830
0x02, /* Response_Code[0] = Invalid Length */
831831
0x00, /* Reason[0] */
832832
};
833+
struct bt_iso_chan *chan;
833834

834-
test_preamble_state_disabling(conn, ase_id, stream);
835+
test_preamble_state_disabling(conn, ase_id, stream, &chan);
835836

836837
ase_cp->write(conn, ase_cp, buf, len, 0, 0);
837838

tests/bluetooth/audio/ascs/src/test_ase_state_transition_invalid.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,12 +432,13 @@ ZTEST_F(test_ase_state_transition_invalid, test_client_source_state_disabling)
432432
const struct bt_gatt_attr *ase_cp = fixture->ase_cp;
433433
struct bt_bap_stream *stream = &fixture->stream;
434434
struct bt_conn *conn = &fixture->conn;
435+
struct bt_iso_chan *chan;
435436
uint8_t ase_id;
436437

437438
Z_TEST_SKIP_IFNDEF(CONFIG_BT_ASCS_ASE_SRC);
438439

439440
ase_id = test_ase_id_get(fixture->ase_src);
440-
test_preamble_state_disabling(conn, ase_id, stream);
441+
test_preamble_state_disabling(conn, ase_id, stream, &chan);
441442

442443
test_client_config_codec_expect_transition_error(conn, ase_id, ase_cp);
443444
test_client_config_qos_expect_transition_error(conn, ase_id, ase_cp);
@@ -679,12 +680,13 @@ ZTEST_F(test_ase_state_transition_invalid, test_server_source_state_disabling)
679680
{
680681
struct bt_bap_stream *stream = &fixture->stream;
681682
struct bt_conn *conn = &fixture->conn;
683+
struct bt_iso_chan *chan;
682684
uint8_t ase_id;
683685

684686
Z_TEST_SKIP_IFNDEF(CONFIG_BT_ASCS_ASE_SRC);
685687

686688
ase_id = test_ase_id_get(fixture->ase_src);
687-
test_preamble_state_disabling(conn, ase_id, stream);
689+
test_preamble_state_disabling(conn, ase_id, stream, &chan);
688690

689691
test_server_config_codec_expect_error(stream);
690692
test_server_config_qos_expect_error(stream);

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,16 +330,15 @@ void test_preamble_state_streaming(struct bt_conn *conn, uint8_t ase_id,
330330
}
331331

332332
void test_preamble_state_disabling(struct bt_conn *conn, uint8_t ase_id,
333-
struct bt_bap_stream *stream)
333+
struct bt_bap_stream *stream, struct bt_iso_chan **chan)
334334
{
335-
struct bt_iso_chan *chan;
336335
int err;
337336

338337
test_ase_control_client_config_codec(conn, ase_id, stream);
339338
test_ase_control_client_config_qos(conn, ase_id);
340339
test_ase_control_client_enable(conn, ase_id);
341340

342-
err = mock_bt_iso_accept(conn, 0x01, 0x01, &chan);
341+
err = mock_bt_iso_accept(conn, 0x01, 0x01, chan);
343342
zassert_equal(0, err, "Failed to connect iso: err %d", err);
344343

345344
test_ase_control_client_receiver_start_ready(conn, ase_id);

0 commit comments

Comments
 (0)