1 /*
2 * Copyright 2023 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 /*
17 * Generated mock file from original source file
18 * Functions generated:41
19 *
20 * mockcify.pl ver 0.7.0
21 */
22
23 // Mock include file to share data between tests and mock
24 #include "test/mock/mock_btif_storage.h"
25
26 #include <cstdint>
27
28 #include "btif/include/btif_api.h"
29 #include "btif/include/btif_storage.h"
30 #include "test/common/mock_functions.h"
31
32 // Original usings
33 using bluetooth::Uuid;
34
35 // Mocked internal structures, if any
36
37 namespace test {
38 namespace mock {
39 namespace btif_storage {
40
41 // Function state capture and return values, if needed
42 struct btif_debug_linkkey_type_dump btif_debug_linkkey_type_dump;
43 struct btif_in_fetch_bonded_ble_device btif_in_fetch_bonded_ble_device;
44 struct btif_in_fetch_bonded_device btif_in_fetch_bonded_device;
45 struct btif_split_uuids_string btif_split_uuids_string;
46 struct btif_storage_add_ble_bonding_key btif_storage_add_ble_bonding_key;
47 struct btif_storage_add_ble_local_key btif_storage_add_ble_local_key;
48 struct btif_storage_add_bonded_device btif_storage_add_bonded_device;
49 struct btif_storage_add_remote_device btif_storage_add_remote_device;
50 struct btif_storage_get_adapter_property btif_storage_get_adapter_property;
51 struct btif_storage_get_ble_bonding_key btif_storage_get_ble_bonding_key;
52 struct btif_storage_get_ble_local_key btif_storage_get_ble_local_key;
53 struct btif_storage_get_gatt_cl_db_hash btif_storage_get_gatt_cl_db_hash;
54 struct btif_storage_get_gatt_cl_supp_feat btif_storage_get_gatt_cl_supp_feat;
55 struct btif_storage_get_remote_addr_type btif_storage_get_remote_addr_type;
56 struct btif_storage_get_remote_device_property btif_storage_get_remote_device_property;
57 struct btif_storage_get_sr_supp_feat btif_storage_get_sr_supp_feat;
58 struct btif_storage_get_stored_remote_name btif_storage_get_stored_remote_name;
59 struct btif_storage_get_cod btif_storage_get_cod;
60 struct btif_storage_is_restricted_device btif_storage_is_restricted_device;
61 struct btif_storage_load_bonded_devices btif_storage_load_bonded_devices;
62 struct btif_storage_load_le_devices btif_storage_load_le_devices;
63 struct btif_storage_remove_ble_bonding_keys btif_storage_remove_ble_bonding_keys;
64 struct btif_storage_remove_bonded_device btif_storage_remove_bonded_device;
65 struct btif_storage_remove_gatt_cl_db_hash btif_storage_remove_gatt_cl_db_hash;
66 struct btif_storage_remove_gatt_cl_supp_feat btif_storage_remove_gatt_cl_supp_feat;
67 struct btif_storage_set_adapter_property btif_storage_set_adapter_property;
68 struct btif_storage_set_gatt_cl_db_hash btif_storage_set_gatt_cl_db_hash;
69 struct btif_storage_set_gatt_cl_supp_feat btif_storage_set_gatt_cl_supp_feat;
70 struct btif_storage_set_gatt_sr_supp_feat btif_storage_set_gatt_sr_supp_feat;
71 struct btif_storage_set_remote_addr_type btif_storage_set_remote_addr_type;
72 struct btif_storage_set_remote_device_property btif_storage_set_remote_device_property;
73 struct btif_storage_get_services btif_storage_get_services;
74
75 } // namespace btif_storage
76 } // namespace mock
77 } // namespace test
78
79 // Mocked function return values, if any
80 namespace test {
81 namespace mock {
82 namespace btif_storage {
83
84 bt_status_t btif_in_fetch_bonded_ble_device::return_value = BT_STATUS_SUCCESS;
85 bt_status_t btif_in_fetch_bonded_device::return_value = BT_STATUS_SUCCESS;
86 size_t btif_split_uuids_string::return_value = 0;
87 bt_status_t btif_storage_add_ble_bonding_key::return_value = BT_STATUS_SUCCESS;
88 bt_status_t btif_storage_add_ble_local_key::return_value = BT_STATUS_SUCCESS;
89 bt_status_t btif_storage_add_bonded_device::return_value = BT_STATUS_SUCCESS;
90 bt_status_t btif_storage_add_remote_device::return_value = BT_STATUS_SUCCESS;
91 bt_status_t btif_storage_get_adapter_property::return_value = BT_STATUS_SUCCESS;
92 bt_status_t btif_storage_get_ble_bonding_key::return_value = BT_STATUS_SUCCESS;
93 bt_status_t btif_storage_get_ble_local_key::return_value = BT_STATUS_SUCCESS;
94 Octet16 btif_storage_get_gatt_cl_db_hash::return_value = {};
95 uint8_t btif_storage_get_gatt_cl_supp_feat::return_value = 0;
96 bt_status_t btif_storage_get_remote_addr_type::return_value = BT_STATUS_SUCCESS;
97 bt_status_t btif_storage_get_remote_device_property::return_value = BT_STATUS_SUCCESS;
98 uint8_t btif_storage_get_sr_supp_feat::return_value = 0;
99 bool btif_storage_get_stored_remote_name::return_value = false;
100 bool btif_storage_get_cod::return_value = false;
101 bool btif_storage_is_restricted_device::return_value = false;
102 bt_status_t btif_storage_load_bonded_devices::return_value = BT_STATUS_SUCCESS;
103 bt_status_t btif_storage_remove_ble_bonding_keys::return_value = BT_STATUS_SUCCESS;
104 bt_status_t btif_storage_remove_bonded_device::return_value = BT_STATUS_SUCCESS;
105 bt_status_t btif_storage_set_adapter_property::return_value = BT_STATUS_SUCCESS;
106 bt_status_t btif_storage_set_remote_device_property::return_value = BT_STATUS_SUCCESS;
107 std::vector<bluetooth::Uuid> btif_storage_get_services::return_value =
108 std::vector<bluetooth::Uuid>();
109
110 } // namespace btif_storage
111 } // namespace mock
112 } // namespace test
113
114 // Mocked functions, if any
btif_debug_linkkey_type_dump(int fd)115 void btif_debug_linkkey_type_dump(int fd) {
116 inc_func_call_count(__func__);
117 test::mock::btif_storage::btif_debug_linkkey_type_dump(fd);
118 }
btif_in_fetch_bonded_ble_device(const std::string & remote_bd_addr,int add,btif_bonded_devices_t * p_bonded_devices)119 bt_status_t btif_in_fetch_bonded_ble_device(const std::string& remote_bd_addr, int add,
120 btif_bonded_devices_t* p_bonded_devices) {
121 inc_func_call_count(__func__);
122 return test::mock::btif_storage::btif_in_fetch_bonded_ble_device(remote_bd_addr, add,
123 p_bonded_devices);
124 }
btif_in_fetch_bonded_device(const std::string & bdstr)125 bt_status_t btif_in_fetch_bonded_device(const std::string& bdstr) {
126 inc_func_call_count(__func__);
127 return test::mock::btif_storage::btif_in_fetch_bonded_device(bdstr);
128 }
btif_split_uuids_string(const char * str,bluetooth::Uuid * p_uuid,size_t max_uuids)129 size_t btif_split_uuids_string(const char* str, bluetooth::Uuid* p_uuid, size_t max_uuids) {
130 inc_func_call_count(__func__);
131 return test::mock::btif_storage::btif_split_uuids_string(str, p_uuid, max_uuids);
132 }
btif_storage_add_ble_bonding_key(RawAddress * remote_bd_addr,const uint8_t * key_value,uint8_t key_type,uint8_t key_length)133 bt_status_t btif_storage_add_ble_bonding_key(RawAddress* remote_bd_addr, const uint8_t* key_value,
134 uint8_t key_type, uint8_t key_length) {
135 inc_func_call_count(__func__);
136 return test::mock::btif_storage::btif_storage_add_ble_bonding_key(remote_bd_addr, key_value,
137 key_type, key_length);
138 }
btif_storage_add_ble_local_key(const Octet16 & key_value,uint8_t key_type)139 bt_status_t btif_storage_add_ble_local_key(const Octet16& key_value, uint8_t key_type) {
140 inc_func_call_count(__func__);
141 return test::mock::btif_storage::btif_storage_add_ble_local_key(key_value, key_type);
142 }
btif_storage_add_bonded_device(RawAddress * remote_bd_addr,LinkKey link_key,uint8_t key_type,uint8_t pin_length)143 bt_status_t btif_storage_add_bonded_device(RawAddress* remote_bd_addr, LinkKey link_key,
144 uint8_t key_type, uint8_t pin_length) {
145 inc_func_call_count(__func__);
146 return test::mock::btif_storage::btif_storage_add_bonded_device(remote_bd_addr, link_key,
147 key_type, pin_length);
148 }
btif_storage_add_remote_device(const RawAddress * remote_bd_addr,uint32_t num_properties,bt_property_t * properties)149 bt_status_t btif_storage_add_remote_device(const RawAddress* remote_bd_addr,
150 uint32_t num_properties, bt_property_t* properties) {
151 inc_func_call_count(__func__);
152 return test::mock::btif_storage::btif_storage_add_remote_device(remote_bd_addr, num_properties,
153 properties);
154 }
btif_storage_get_adapter_property(bt_property_t * property)155 bt_status_t btif_storage_get_adapter_property(bt_property_t* property) {
156 inc_func_call_count(__func__);
157 return test::mock::btif_storage::btif_storage_get_adapter_property(property);
158 }
btif_storage_get_ble_bonding_key(const RawAddress & remote_bd_addr,uint8_t key_type,uint8_t * key_value,int key_length)159 bt_status_t btif_storage_get_ble_bonding_key(const RawAddress& remote_bd_addr, uint8_t key_type,
160 uint8_t* key_value, int key_length) {
161 inc_func_call_count(__func__);
162 return test::mock::btif_storage::btif_storage_get_ble_bonding_key(remote_bd_addr, key_type,
163 key_value, key_length);
164 }
btif_storage_get_ble_local_key(uint8_t key_type,Octet16 * key_value)165 bt_status_t btif_storage_get_ble_local_key(uint8_t key_type, Octet16* key_value) {
166 inc_func_call_count(__func__);
167 return test::mock::btif_storage::btif_storage_get_ble_local_key(key_type, key_value);
168 }
btif_storage_get_gatt_cl_db_hash(const RawAddress & bd_addr)169 Octet16 btif_storage_get_gatt_cl_db_hash(const RawAddress& bd_addr) {
170 inc_func_call_count(__func__);
171 return test::mock::btif_storage::btif_storage_get_gatt_cl_db_hash(bd_addr);
172 }
btif_storage_get_gatt_cl_supp_feat(const RawAddress & bd_addr)173 uint8_t btif_storage_get_gatt_cl_supp_feat(const RawAddress& bd_addr) {
174 inc_func_call_count(__func__);
175 return test::mock::btif_storage::btif_storage_get_gatt_cl_supp_feat(bd_addr);
176 }
btif_storage_get_remote_addr_type(const RawAddress * remote_bd_addr,tBLE_ADDR_TYPE * addr_type)177 bt_status_t btif_storage_get_remote_addr_type(const RawAddress* remote_bd_addr,
178 tBLE_ADDR_TYPE* addr_type) {
179 inc_func_call_count(__func__);
180 return test::mock::btif_storage::btif_storage_get_remote_addr_type(remote_bd_addr, addr_type);
181 }
btif_storage_get_remote_device_property(const RawAddress * remote_bd_addr,bt_property_t * property)182 bt_status_t btif_storage_get_remote_device_property(const RawAddress* remote_bd_addr,
183 bt_property_t* property) {
184 inc_func_call_count(__func__);
185 return test::mock::btif_storage::btif_storage_get_remote_device_property(remote_bd_addr,
186 property);
187 }
btif_storage_get_sr_supp_feat(const RawAddress & bd_addr)188 uint8_t btif_storage_get_sr_supp_feat(const RawAddress& bd_addr) {
189 inc_func_call_count(__func__);
190 return test::mock::btif_storage::btif_storage_get_sr_supp_feat(bd_addr);
191 }
btif_storage_get_stored_remote_name(const RawAddress & bd_addr,char * name)192 bool btif_storage_get_stored_remote_name(const RawAddress& bd_addr, char* name) {
193 inc_func_call_count(__func__);
194 return test::mock::btif_storage::btif_storage_get_stored_remote_name(bd_addr, name);
195 }
btif_storage_get_cod(const RawAddress & bd_addr,uint32_t * cod)196 bool btif_storage_get_cod(const RawAddress& bd_addr, uint32_t* cod) {
197 inc_func_call_count(__func__);
198 return test::mock::btif_storage::btif_storage_get_cod(bd_addr, cod);
199 }
btif_storage_is_restricted_device(const RawAddress * remote_bd_addr)200 bool btif_storage_is_restricted_device(const RawAddress* remote_bd_addr) {
201 inc_func_call_count(__func__);
202 return test::mock::btif_storage::btif_storage_is_restricted_device(remote_bd_addr);
203 }
btif_storage_load_bonded_devices(void)204 bt_status_t btif_storage_load_bonded_devices(void) {
205 inc_func_call_count(__func__);
206 return test::mock::btif_storage::btif_storage_load_bonded_devices();
207 }
btif_storage_load_le_devices(void)208 void btif_storage_load_le_devices(void) {
209 inc_func_call_count(__func__);
210 test::mock::btif_storage::btif_storage_load_le_devices();
211 }
btif_storage_remove_ble_bonding_keys(const RawAddress * remote_bd_addr)212 bt_status_t btif_storage_remove_ble_bonding_keys(const RawAddress* remote_bd_addr) {
213 inc_func_call_count(__func__);
214 return test::mock::btif_storage::btif_storage_remove_ble_bonding_keys(remote_bd_addr);
215 }
btif_storage_remove_bonded_device(const RawAddress * remote_bd_addr)216 bt_status_t btif_storage_remove_bonded_device(const RawAddress* remote_bd_addr) {
217 inc_func_call_count(__func__);
218 return test::mock::btif_storage::btif_storage_remove_bonded_device(remote_bd_addr);
219 }
btif_storage_remove_gatt_cl_db_hash(const RawAddress & bd_addr)220 void btif_storage_remove_gatt_cl_db_hash(const RawAddress& bd_addr) {
221 inc_func_call_count(__func__);
222 test::mock::btif_storage::btif_storage_remove_gatt_cl_db_hash(bd_addr);
223 }
btif_storage_remove_gatt_cl_supp_feat(const RawAddress & bd_addr)224 void btif_storage_remove_gatt_cl_supp_feat(const RawAddress& bd_addr) {
225 inc_func_call_count(__func__);
226 test::mock::btif_storage::btif_storage_remove_gatt_cl_supp_feat(bd_addr);
227 }
btif_storage_set_adapter_property(bt_property_t * property)228 bt_status_t btif_storage_set_adapter_property(bt_property_t* property) {
229 inc_func_call_count(__func__);
230 return test::mock::btif_storage::btif_storage_set_adapter_property(property);
231 }
btif_storage_set_gatt_cl_db_hash(const RawAddress & bd_addr,Octet16 hash)232 void btif_storage_set_gatt_cl_db_hash(const RawAddress& bd_addr, Octet16 hash) {
233 inc_func_call_count(__func__);
234 test::mock::btif_storage::btif_storage_set_gatt_cl_db_hash(bd_addr, hash);
235 }
btif_storage_set_gatt_cl_supp_feat(const RawAddress & bd_addr,uint8_t feat)236 void btif_storage_set_gatt_cl_supp_feat(const RawAddress& bd_addr, uint8_t feat) {
237 inc_func_call_count(__func__);
238 test::mock::btif_storage::btif_storage_set_gatt_cl_supp_feat(bd_addr, feat);
239 }
btif_storage_set_gatt_sr_supp_feat(const RawAddress & addr,uint8_t feat)240 void btif_storage_set_gatt_sr_supp_feat(const RawAddress& addr, uint8_t feat) {
241 inc_func_call_count(__func__);
242 test::mock::btif_storage::btif_storage_set_gatt_sr_supp_feat(addr, feat);
243 }
btif_storage_set_remote_addr_type(const RawAddress * remote_bd_addr,const tBLE_ADDR_TYPE addr_type)244 bt_status_t btif_storage_set_remote_addr_type(const RawAddress* remote_bd_addr,
245 const tBLE_ADDR_TYPE addr_type) {
246 inc_func_call_count(__func__);
247 return test::mock::btif_storage::btif_storage_set_remote_addr_type(remote_bd_addr, addr_type);
248 }
btif_storage_set_remote_device_property(const RawAddress * remote_bd_addr,bt_property_t * property)249 bt_status_t btif_storage_set_remote_device_property(const RawAddress* remote_bd_addr,
250 bt_property_t* property) {
251 inc_func_call_count(__func__);
252 return test::mock::btif_storage::btif_storage_set_remote_device_property(remote_bd_addr,
253 property);
254 }
btif_storage_get_services(const RawAddress & bd_addr,tBT_TRANSPORT transport)255 std::vector<bluetooth::Uuid> btif_storage_get_services(const RawAddress& bd_addr,
256 tBT_TRANSPORT transport) {
257 inc_func_call_count(__func__);
258 return test::mock::btif_storage::btif_storage_get_services(bd_addr, transport);
259 }
260 // Mocked functions complete
261 // END mockcify generation
262