Skip to content

Commit 026a2c5

Browse files
Thalleykartben
authored andcommitted
tests: Bluetooth: Audio: Spring cleanup for audio test files
Add missing and remove unused includes. Fix spelling mistakes. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
1 parent 48aedc9 commit 026a2c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+277
-61
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66

77
#ifndef MOCKS_BAP_UNICAST_SERVER_H_
88
#define MOCKS_BAP_UNICAST_SERVER_H_
9+
#include <stddef.h>
10+
#include <stdint.h>
911

12+
#include <zephyr/bluetooth/audio/audio.h>
13+
#include <zephyr/bluetooth/conn.h>
1014
#include <zephyr/fff.h>
1115
#include <zephyr/bluetooth/audio/bap.h>
1216

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#define MOCKS_BAP_UNICAST_SERVER_EXPECTS_H_
99

1010
#include <zephyr/bluetooth/audio/bap.h>
11+
#include <zephyr/ztest_assert.h>
1112

1213
#include "bap_unicast_server.h"
1314
#include "expects_util.h"

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6+
#include <stdint.h>
67

78
#include <zephyr/bluetooth/audio/bap.h>
89
#include <zephyr/bluetooth/conn.h>
910
#include <zephyr/bluetooth/gatt.h>
11+
#include <zephyr/bluetooth/iso.h>
12+
#include <zephyr/bluetooth/uuid.h>
1013

1114
#define test_ase_snk_get(_num_ase, ...) test_ase_get(BT_UUID_ASCS_ASE_SNK, _num_ase, __VA_ARGS__)
1215
#define test_ase_src_get(_num_ase, ...) test_ase_get(BT_UUID_ASCS_ASE_SRC, _num_ase, __VA_ARGS__)

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@
99
*/
1010

1111
#include <errno.h>
12+
#include <stdint.h>
1213
#include <stdlib.h>
1314
#include <string.h>
15+
16+
#include <zephyr/bluetooth/gap.h>
17+
#include <zephyr/bluetooth/iso.h>
1418
#include <zephyr/fff.h>
1519
#include <zephyr/kernel.h>
1620
#include <zephyr/bluetooth/audio/audio.h>
@@ -20,10 +24,13 @@
2024
#include <zephyr/bluetooth/hci_types.h>
2125
#include <zephyr/bluetooth/gatt.h>
2226
#include <zephyr/bluetooth/uuid.h>
27+
#include <zephyr/net_buf.h>
2328
#include <zephyr/sys/util_macro.h>
29+
#include <zephyr/ztest_assert.h>
30+
#include <zephyr/ztest_test.h>
31+
#include <sys/types.h>
2432

2533
#include "assert.h"
26-
#include "ascs_internal.h"
2734
#include "bap_unicast_server.h"
2835
#include "bap_unicast_server_expects.h"
2936
#include "bap_stream.h"
@@ -32,11 +39,8 @@
3239
#include "gatt.h"
3340
#include "gatt_expects.h"
3441
#include "iso.h"
35-
#include "mock_kernel.h"
36-
#include "pacs.h"
3742

3843
#include "test_common.h"
39-
#include "ztest_assert.h"
4044

4145
DEFINE_FFF_GLOBALS;
4246

@@ -193,7 +197,7 @@ ZTEST_F(ascs_test_suite, test_release_ase_on_callback_unregister)
193197
/* Reset mock, as we expect ASE notification to be sent */
194198
bt_gatt_notify_cb_reset();
195199

196-
/* Unregister the callbacks - whis will clean up the ASCS */
200+
/* Unregister the callbacks - which will clean up the ASCS */
197201
bt_bap_unicast_server_unregister_cb(&mock_bap_unicast_server_cb);
198202

199203
/* Expected to notify the upper layers */

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,28 @@
99

1010
#include <stdint.h>
1111
#include <stdlib.h>
12+
#include <zephyr/bluetooth/gap.h>
13+
#include <zephyr/bluetooth/iso.h>
14+
#include <zephyr/bluetooth/uuid.h>
1215
#include <zephyr/kernel.h>
16+
#include <zephyr/toolchain.h>
1317
#include <zephyr/types.h>
1418
#include <zephyr/bluetooth/audio/audio.h>
1519
#include <zephyr/bluetooth/audio/bap.h>
1620
#include <zephyr/bluetooth/conn.h>
1721
#include <zephyr/bluetooth/gatt.h>
1822
#include <zephyr/sys/util_macro.h>
23+
#include <zephyr/ztest_assert.h>
24+
#include <zephyr/ztest_test.h>
25+
#include <sys/types.h>
1926

2027
#include "bap_unicast_server.h"
21-
#include "bap_unicast_server_expects.h"
2228
#include "bap_stream.h"
23-
#include "bap_stream_expects.h"
2429
#include "conn.h"
25-
#include "gatt.h"
2630
#include "gatt_expects.h"
2731
#include "iso.h"
2832

2933
#include "test_common.h"
30-
#include "ztest_assert.h"
3134

3235
struct test_ase_control_params_fixture {
3336
struct bt_conn conn;

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@
2828

2929
#include "assert.h"
3030
#include "bap_unicast_server.h"
31-
#include "bap_unicast_server_expects.h"
3231
#include "bap_stream.h"
33-
#include "bap_stream_expects.h"
34-
#include "conn.h"
3532

3633
#include "test_common.h"
3734

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,31 @@
77
* SPDX-License-Identifier: Apache-2.0
88
*/
99

10+
#include <stdint.h>
1011
#include <stdlib.h>
12+
#include <string.h>
13+
14+
#include <zephyr/bluetooth/audio/lc3.h>
15+
#include <zephyr/bluetooth/byteorder.h>
16+
#include <zephyr/bluetooth/gap.h>
17+
#include <zephyr/bluetooth/hci_types.h>
18+
#include <zephyr/bluetooth/iso.h>
1119
#include <zephyr/kernel.h>
20+
#include <zephyr/sys/util.h>
1221
#include <zephyr/types.h>
1322
#include <zephyr/bluetooth/audio/audio.h>
1423
#include <zephyr/bluetooth/audio/bap.h>
1524
#include <zephyr/bluetooth/conn.h>
1625
#include <zephyr/bluetooth/gatt.h>
1726
#include <zephyr/sys/util_macro.h>
1827
#include <zephyr/ztest_assert.h>
28+
#include <zephyr/ztest_test.h>
1929

2030
#include "bap_unicast_server.h"
2131
#include "bap_unicast_server_expects.h"
2232
#include "bap_stream.h"
2333
#include "bap_stream_expects.h"
2434
#include "conn.h"
25-
#include "gatt.h"
26-
#include "gatt_expects.h"
2735
#include "iso.h"
2836

2937
#include "test_common.h"

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,31 @@
77
* SPDX-License-Identifier: Apache-2.0
88
*/
99

10+
#include <stdint.h>
1011
#include <stdlib.h>
12+
#include <string.h>
13+
14+
#include <zephyr/bluetooth/audio/lc3.h>
15+
#include <zephyr/bluetooth/byteorder.h>
16+
#include <zephyr/bluetooth/iso.h>
17+
#include <zephyr/bluetooth/uuid.h>
1118
#include <zephyr/kernel.h>
19+
#include <zephyr/sys/slist.h>
20+
#include <zephyr/sys/util.h>
1221
#include <zephyr/types.h>
1322
#include <zephyr/bluetooth/audio/audio.h>
1423
#include <zephyr/bluetooth/audio/bap.h>
1524
#include <zephyr/bluetooth/conn.h>
1625
#include <zephyr/bluetooth/gatt.h>
1726
#include <zephyr/sys/util_macro.h>
27+
#include <zephyr/ztest_assert.h>
28+
#include <zephyr/ztest_test.h>
29+
#include <sys/types.h>
1830

1931
#include "bap_unicast_server.h"
20-
#include "bap_unicast_server_expects.h"
2132
#include "bap_stream.h"
22-
#include "bap_stream_expects.h"
2333
#include "conn.h"
24-
#include "gatt.h"
2534
#include "gatt_expects.h"
26-
#include "iso.h"
2735

2836
#include "test_common.h"
2937

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6-
6+
#include <stdarg.h>
7+
#include <stddef.h>
8+
#include <stdint.h>
9+
10+
#include <zephyr/bluetooth/att.h>
11+
#include <zephyr/bluetooth/gap.h>
12+
#include <zephyr/bluetooth/hci_types.h>
13+
#include <zephyr/bluetooth/iso.h>
714
#include <zephyr/fff.h>
815
#include <zephyr/types.h>
916
#include <zephyr/bluetooth/audio/audio.h>
@@ -12,10 +19,11 @@
1219
#include <zephyr/bluetooth/gatt.h>
1320
#include <zephyr/bluetooth/uuid.h>
1421
#include <zephyr/sys/util_macro.h>
22+
#include <zephyr/ztest_assert.h>
23+
#include <sys/types.h>
1524

1625
#include "bap_unicast_server.h"
1726
#include "bap_stream.h"
18-
#include "gatt_expects.h"
1927
#include "conn.h"
2028
#include "gatt.h"
2129
#include "iso.h"
@@ -355,7 +363,7 @@ void test_preamble_state_releasing(struct bt_conn *conn, uint8_t ase_id,
355363
test_preamble_state_streaming(conn, ase_id, stream, chan, source);
356364
test_ase_control_client_release(conn, ase_id);
357365

358-
/* Reset the mocks espacially the function call count */
366+
/* Reset the mocks especially the function call count */
359367
mock_bap_unicast_server_cleanup();
360368
mock_bt_iso_cleanup();
361369
mock_bap_stream_cleanup();

tests/bluetooth/audio/ascs/uut/bap_unicast_client.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6+
#include <stddef.h>
7+
#include <stdint.h>
68

9+
#include <zephyr/bluetooth/audio/audio.h>
710
#include <zephyr/bluetooth/audio/bap.h>
11+
#include <zephyr/bluetooth/conn.h>
12+
#include <zephyr/ztest_assert.h>
813

914
bool bt_bap_ep_is_unicast_client(const struct bt_bap_ep *ep)
1015
{

0 commit comments

Comments
 (0)