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 "test/common/mock_functions.h"
29
30 // Original usings
31 using bluetooth::Uuid;
32
33 // Mocked internal structures, if any
34
35 namespace test {
36 namespace mock {
37 namespace btif_storage {
38
39 // Function state capture and return values, if needed
40 struct btif_debug_linkkey_type_dump btif_debug_linkkey_type_dump;
41 struct btif_has_ble_keys btif_has_ble_keys;
42 struct btif_in_fetch_bonded_ble_device btif_in_fetch_bonded_ble_device;
43 struct btif_in_fetch_bonded_device btif_in_fetch_bonded_device;
44 struct btif_split_uuids_string btif_split_uuids_string;
45 struct btif_storage_add_ble_bonding_key btif_storage_add_ble_bonding_key;
46 struct btif_storage_add_ble_local_key btif_storage_add_ble_local_key;
47 struct btif_storage_add_bonded_device btif_storage_add_bonded_device;
48 struct btif_storage_add_remote_device btif_storage_add_remote_device;
49 struct btif_storage_get_adapter_prop btif_storage_get_adapter_prop;
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
57 btif_storage_get_remote_device_property;
58 struct btif_storage_get_remote_prop btif_storage_get_remote_prop;
59 struct btif_storage_get_sr_supp_feat btif_storage_get_sr_supp_feat;
60 struct btif_storage_get_stored_remote_name btif_storage_get_stored_remote_name;
61 struct btif_storage_invoke_addr_type_update
62 btif_storage_invoke_addr_type_update;
63 struct btif_storage_is_restricted_device btif_storage_is_restricted_device;
64 struct btif_storage_load_bonded_devices btif_storage_load_bonded_devices;
65 struct btif_storage_load_le_devices btif_storage_load_le_devices;
66 struct btif_storage_remove_ble_bonding_keys
67 btif_storage_remove_ble_bonding_keys;
68 struct btif_storage_remove_bonded_device btif_storage_remove_bonded_device;
69 struct btif_storage_remove_gatt_cl_db_hash btif_storage_remove_gatt_cl_db_hash;
70 struct btif_storage_remove_gatt_cl_supp_feat
71 btif_storage_remove_gatt_cl_supp_feat;
72 struct btif_storage_set_adapter_property btif_storage_set_adapter_property;
73 struct btif_storage_set_gatt_cl_db_hash btif_storage_set_gatt_cl_db_hash;
74 struct btif_storage_set_gatt_cl_supp_feat btif_storage_set_gatt_cl_supp_feat;
75 struct btif_storage_set_gatt_sr_supp_feat btif_storage_set_gatt_sr_supp_feat;
76 struct btif_storage_set_remote_addr_type btif_storage_set_remote_addr_type;
77 struct btif_storage_set_remote_device_property
78 btif_storage_set_remote_device_property;
79
80 } // namespace btif_storage
81 } // namespace mock
82 } // namespace test
83
84 // Mocked function return values, if any
85 namespace test {
86 namespace mock {
87 namespace btif_storage {
88
89 bool btif_has_ble_keys::return_value = false;
90 bt_status_t btif_in_fetch_bonded_ble_device::return_value = BT_STATUS_SUCCESS;
91 bt_status_t btif_in_fetch_bonded_device::return_value = BT_STATUS_SUCCESS;
92 size_t btif_split_uuids_string::return_value = 0;
93 bt_status_t btif_storage_add_ble_bonding_key::return_value = BT_STATUS_SUCCESS;
94 bt_status_t btif_storage_add_ble_local_key::return_value = BT_STATUS_SUCCESS;
95 bt_status_t btif_storage_add_bonded_device::return_value = BT_STATUS_SUCCESS;
96 bt_status_t btif_storage_add_remote_device::return_value = BT_STATUS_SUCCESS;
97 bt_status_t btif_storage_get_adapter_prop::return_value = BT_STATUS_SUCCESS;
98 bt_status_t btif_storage_get_adapter_property::return_value = BT_STATUS_SUCCESS;
99 bt_status_t btif_storage_get_ble_bonding_key::return_value = BT_STATUS_SUCCESS;
100 bt_status_t btif_storage_get_ble_local_key::return_value = BT_STATUS_SUCCESS;
101 Octet16 btif_storage_get_gatt_cl_db_hash::return_value = {};
102 uint8_t btif_storage_get_gatt_cl_supp_feat::return_value = 0;
103 bt_status_t btif_storage_get_remote_addr_type::return_value = BT_STATUS_SUCCESS;
104 bt_status_t btif_storage_get_remote_device_property::return_value =
105 BT_STATUS_SUCCESS;
106 bt_status_t btif_storage_get_remote_prop::return_value = BT_STATUS_SUCCESS;
107 uint8_t btif_storage_get_sr_supp_feat::return_value = 0;
108 bool btif_storage_get_stored_remote_name::return_value = false;
109 bool btif_storage_is_restricted_device::return_value = false;
110 bt_status_t btif_storage_load_bonded_devices::return_value = BT_STATUS_SUCCESS;
111 bt_status_t btif_storage_remove_ble_bonding_keys::return_value =
112 BT_STATUS_SUCCESS;
113 bt_status_t btif_storage_remove_bonded_device::return_value = BT_STATUS_SUCCESS;
114 bt_status_t btif_storage_set_adapter_property::return_value = BT_STATUS_SUCCESS;
115 bt_status_t btif_storage_set_remote_device_property::return_value =
116 BT_STATUS_SUCCESS;
117
118 } // namespace btif_storage
119 } // namespace mock
120 } // namespace test
121
122 // Mocked functions, if any
btif_debug_linkkey_type_dump(int fd)123 void btif_debug_linkkey_type_dump(int fd) {
124 inc_func_call_count(__func__);
125 test::mock::btif_storage::btif_debug_linkkey_type_dump(fd);
126 }
btif_has_ble_keys(const std::string & bdstr)127 bool btif_has_ble_keys(const std::string& bdstr) {
128 inc_func_call_count(__func__);
129 return test::mock::btif_storage::btif_has_ble_keys(bdstr);
130 }
btif_in_fetch_bonded_ble_device(const std::string & remote_bd_addr,int add,btif_bonded_devices_t * p_bonded_devices)131 bt_status_t btif_in_fetch_bonded_ble_device(
132 const std::string& remote_bd_addr, int add,
133 btif_bonded_devices_t* p_bonded_devices) {
134 inc_func_call_count(__func__);
135 return test::mock::btif_storage::btif_in_fetch_bonded_ble_device(
136 remote_bd_addr, add, p_bonded_devices);
137 }
btif_in_fetch_bonded_device(const std::string & bdstr)138 bt_status_t btif_in_fetch_bonded_device(const std::string& bdstr) {
139 inc_func_call_count(__func__);
140 return test::mock::btif_storage::btif_in_fetch_bonded_device(bdstr);
141 }
btif_split_uuids_string(const char * str,bluetooth::Uuid * p_uuid,size_t max_uuids)142 size_t btif_split_uuids_string(const char* str, bluetooth::Uuid* p_uuid,
143 size_t max_uuids) {
144 inc_func_call_count(__func__);
145 return test::mock::btif_storage::btif_split_uuids_string(str, p_uuid,
146 max_uuids);
147 }
btif_storage_add_ble_bonding_key(RawAddress * remote_bd_addr,const uint8_t * key_value,uint8_t key_type,uint8_t key_length)148 bt_status_t btif_storage_add_ble_bonding_key(RawAddress* remote_bd_addr,
149 const uint8_t* key_value,
150 uint8_t key_type,
151 uint8_t key_length) {
152 inc_func_call_count(__func__);
153 return test::mock::btif_storage::btif_storage_add_ble_bonding_key(
154 remote_bd_addr, key_value, key_type, key_length);
155 }
btif_storage_add_ble_local_key(const Octet16 & key_value,uint8_t key_type)156 bt_status_t btif_storage_add_ble_local_key(const Octet16& key_value,
157 uint8_t key_type) {
158 inc_func_call_count(__func__);
159 return test::mock::btif_storage::btif_storage_add_ble_local_key(key_value,
160 key_type);
161 }
btif_storage_add_bonded_device(RawAddress * remote_bd_addr,LinkKey link_key,uint8_t key_type,uint8_t pin_length)162 bt_status_t btif_storage_add_bonded_device(RawAddress* remote_bd_addr,
163 LinkKey link_key, uint8_t key_type,
164 uint8_t pin_length) {
165 inc_func_call_count(__func__);
166 return test::mock::btif_storage::btif_storage_add_bonded_device(
167 remote_bd_addr, link_key, key_type, pin_length);
168 }
btif_storage_add_remote_device(const RawAddress * remote_bd_addr,uint32_t num_properties,bt_property_t * properties)169 bt_status_t btif_storage_add_remote_device(const RawAddress* remote_bd_addr,
170 uint32_t num_properties,
171 bt_property_t* properties) {
172 inc_func_call_count(__func__);
173 return test::mock::btif_storage::btif_storage_add_remote_device(
174 remote_bd_addr, num_properties, properties);
175 }
btif_storage_get_adapter_prop(bt_property_type_t type,void * buf,int size,bt_property_t * property)176 bt_status_t btif_storage_get_adapter_prop(bt_property_type_t type, void* buf,
177 int size, bt_property_t* property) {
178 inc_func_call_count(__func__);
179 return test::mock::btif_storage::btif_storage_get_adapter_prop(
180 type, buf, size, property);
181 }
btif_storage_get_adapter_property(bt_property_t * property)182 bt_status_t btif_storage_get_adapter_property(bt_property_t* property) {
183 inc_func_call_count(__func__);
184 return test::mock::btif_storage::btif_storage_get_adapter_property(property);
185 }
btif_storage_get_ble_bonding_key(const RawAddress & remote_bd_addr,uint8_t key_type,uint8_t * key_value,int key_length)186 bt_status_t btif_storage_get_ble_bonding_key(const RawAddress& remote_bd_addr,
187 uint8_t key_type,
188 uint8_t* key_value,
189 int key_length) {
190 inc_func_call_count(__func__);
191 return test::mock::btif_storage::btif_storage_get_ble_bonding_key(
192 remote_bd_addr, key_type, key_value, key_length);
193 }
btif_storage_get_ble_local_key(uint8_t key_type,Octet16 * key_value)194 bt_status_t btif_storage_get_ble_local_key(uint8_t key_type,
195 Octet16* key_value) {
196 inc_func_call_count(__func__);
197 return test::mock::btif_storage::btif_storage_get_ble_local_key(key_type,
198 key_value);
199 }
btif_storage_get_gatt_cl_db_hash(const RawAddress & bd_addr)200 Octet16 btif_storage_get_gatt_cl_db_hash(const RawAddress& bd_addr) {
201 inc_func_call_count(__func__);
202 return test::mock::btif_storage::btif_storage_get_gatt_cl_db_hash(bd_addr);
203 }
btif_storage_get_gatt_cl_supp_feat(const RawAddress & bd_addr)204 uint8_t btif_storage_get_gatt_cl_supp_feat(const RawAddress& bd_addr) {
205 inc_func_call_count(__func__);
206 return test::mock::btif_storage::btif_storage_get_gatt_cl_supp_feat(bd_addr);
207 }
btif_storage_get_remote_addr_type(const RawAddress * remote_bd_addr,tBLE_ADDR_TYPE * addr_type)208 bt_status_t btif_storage_get_remote_addr_type(const RawAddress* remote_bd_addr,
209 tBLE_ADDR_TYPE* addr_type) {
210 inc_func_call_count(__func__);
211 return test::mock::btif_storage::btif_storage_get_remote_addr_type(
212 remote_bd_addr, addr_type);
213 }
btif_storage_get_remote_device_property(const RawAddress * remote_bd_addr,bt_property_t * property)214 bt_status_t btif_storage_get_remote_device_property(
215 const RawAddress* remote_bd_addr, bt_property_t* property) {
216 inc_func_call_count(__func__);
217 return test::mock::btif_storage::btif_storage_get_remote_device_property(
218 remote_bd_addr, property);
219 }
btif_storage_get_remote_prop(RawAddress * remote_addr,bt_property_type_t type,void * buf,int size,bt_property_t * property)220 bt_status_t btif_storage_get_remote_prop(RawAddress* remote_addr,
221 bt_property_type_t type, void* buf,
222 int size, bt_property_t* property) {
223 inc_func_call_count(__func__);
224 return test::mock::btif_storage::btif_storage_get_remote_prop(
225 remote_addr, type, buf, size, property);
226 }
btif_storage_get_sr_supp_feat(const RawAddress & bd_addr)227 uint8_t btif_storage_get_sr_supp_feat(const RawAddress& bd_addr) {
228 inc_func_call_count(__func__);
229 return test::mock::btif_storage::btif_storage_get_sr_supp_feat(bd_addr);
230 }
btif_storage_get_stored_remote_name(const RawAddress & bd_addr,char * name)231 bool btif_storage_get_stored_remote_name(const RawAddress& bd_addr,
232 char* name) {
233 inc_func_call_count(__func__);
234 return test::mock::btif_storage::btif_storage_get_stored_remote_name(bd_addr,
235 name);
236 }
btif_storage_invoke_addr_type_update(const RawAddress & remote_bd_addr,const tBLE_ADDR_TYPE & addr_type)237 void btif_storage_invoke_addr_type_update(const RawAddress& remote_bd_addr,
238 const tBLE_ADDR_TYPE& addr_type) {
239 inc_func_call_count(__func__);
240 test::mock::btif_storage::btif_storage_invoke_addr_type_update(remote_bd_addr,
241 addr_type);
242 }
btif_storage_is_restricted_device(const RawAddress * remote_bd_addr)243 bool btif_storage_is_restricted_device(const RawAddress* remote_bd_addr) {
244 inc_func_call_count(__func__);
245 return test::mock::btif_storage::btif_storage_is_restricted_device(
246 remote_bd_addr);
247 }
btif_storage_load_bonded_devices(void)248 bt_status_t btif_storage_load_bonded_devices(void) {
249 inc_func_call_count(__func__);
250 return test::mock::btif_storage::btif_storage_load_bonded_devices();
251 }
btif_storage_load_le_devices(void)252 void btif_storage_load_le_devices(void) {
253 inc_func_call_count(__func__);
254 test::mock::btif_storage::btif_storage_load_le_devices();
255 }
btif_storage_remove_ble_bonding_keys(const RawAddress * remote_bd_addr)256 bt_status_t btif_storage_remove_ble_bonding_keys(
257 const RawAddress* remote_bd_addr) {
258 inc_func_call_count(__func__);
259 return test::mock::btif_storage::btif_storage_remove_ble_bonding_keys(
260 remote_bd_addr);
261 }
btif_storage_remove_bonded_device(const RawAddress * remote_bd_addr)262 bt_status_t btif_storage_remove_bonded_device(
263 const RawAddress* remote_bd_addr) {
264 inc_func_call_count(__func__);
265 return test::mock::btif_storage::btif_storage_remove_bonded_device(
266 remote_bd_addr);
267 }
btif_storage_remove_gatt_cl_db_hash(const RawAddress & bd_addr)268 void btif_storage_remove_gatt_cl_db_hash(const RawAddress& bd_addr) {
269 inc_func_call_count(__func__);
270 test::mock::btif_storage::btif_storage_remove_gatt_cl_db_hash(bd_addr);
271 }
btif_storage_remove_gatt_cl_supp_feat(const RawAddress & bd_addr)272 void btif_storage_remove_gatt_cl_supp_feat(const RawAddress& bd_addr) {
273 inc_func_call_count(__func__);
274 test::mock::btif_storage::btif_storage_remove_gatt_cl_supp_feat(bd_addr);
275 }
btif_storage_set_adapter_property(bt_property_t * property)276 bt_status_t btif_storage_set_adapter_property(bt_property_t* property) {
277 inc_func_call_count(__func__);
278 return test::mock::btif_storage::btif_storage_set_adapter_property(property);
279 }
btif_storage_set_gatt_cl_db_hash(const RawAddress & bd_addr,Octet16 hash)280 void btif_storage_set_gatt_cl_db_hash(const RawAddress& bd_addr, Octet16 hash) {
281 inc_func_call_count(__func__);
282 test::mock::btif_storage::btif_storage_set_gatt_cl_db_hash(bd_addr, hash);
283 }
btif_storage_set_gatt_cl_supp_feat(const RawAddress & bd_addr,uint8_t feat)284 void btif_storage_set_gatt_cl_supp_feat(const RawAddress& bd_addr,
285 uint8_t feat) {
286 inc_func_call_count(__func__);
287 test::mock::btif_storage::btif_storage_set_gatt_cl_supp_feat(bd_addr, feat);
288 }
btif_storage_set_gatt_sr_supp_feat(const RawAddress & addr,uint8_t feat)289 void btif_storage_set_gatt_sr_supp_feat(const RawAddress& addr, uint8_t feat) {
290 inc_func_call_count(__func__);
291 test::mock::btif_storage::btif_storage_set_gatt_sr_supp_feat(addr, feat);
292 }
btif_storage_set_remote_addr_type(const RawAddress * remote_bd_addr,const tBLE_ADDR_TYPE addr_type)293 bt_status_t btif_storage_set_remote_addr_type(const RawAddress* remote_bd_addr,
294 const tBLE_ADDR_TYPE addr_type) {
295 inc_func_call_count(__func__);
296 return test::mock::btif_storage::btif_storage_set_remote_addr_type(
297 remote_bd_addr, addr_type);
298 }
btif_storage_set_remote_device_property(const RawAddress * remote_bd_addr,bt_property_t * property)299 bt_status_t btif_storage_set_remote_device_property(
300 const RawAddress* remote_bd_addr, bt_property_t* property) {
301 inc_func_call_count(__func__);
302 return test::mock::btif_storage::btif_storage_set_remote_device_property(
303 remote_bd_addr, property);
304 }
305 // Mocked functions complete
306 // END mockcify generation
307