1 /* test_common.c - common procedures for unit test of CAP commander */
2 
3 /*
4  * Copyright (c) 2024 Nordic Semiconductor ASA
5  *
6  * SPDX-License-Identifier: Apache-2.0
7  */
8 
9 #include "cap_commander.h"
10 #include "conn.h"
11 #include "cap_mocks.h"
12 #include "test_common.h"
13 
test_mocks_init(void)14 void test_mocks_init(void)
15 {
16 	mock_cap_commander_init();
17 	mock_bt_aics_init();
18 	mock_bt_csip_init();
19 	mock_bt_micp_init();
20 	mock_bt_vcp_init();
21 	mock_bt_vocs_init();
22 }
23 
test_mocks_cleanup(void)24 void test_mocks_cleanup(void)
25 {
26 	mock_cap_commander_cleanup();
27 	mock_bt_aics_cleanup();
28 	mock_bt_csip_cleanup();
29 	mock_bt_micp_cleanup();
30 	mock_bt_vcp_cleanup();
31 	mock_bt_vocs_cleanup();
32 }
33 
test_conn_init(struct bt_conn * conn)34 void test_conn_init(struct bt_conn *conn)
35 {
36 	conn->index = 0;
37 	conn->info.type = BT_CONN_TYPE_LE;
38 	conn->info.role = BT_CONN_ROLE_PERIPHERAL;
39 	conn->info.state = BT_CONN_STATE_CONNECTED;
40 	conn->info.security.level = BT_SECURITY_L2;
41 	conn->info.security.enc_key_size = BT_ENC_KEY_SIZE_MAX;
42 	conn->info.security.flags = BT_SECURITY_FLAG_OOB | BT_SECURITY_FLAG_SC;
43 }
44