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 #pragma once
17 
18 /*
19  * Generated mock file from original source file
20  *   Functions generated:34
21  *
22  *  mockcify.pl ver 0.6.2
23  */
24 
25 #include <cstdint>
26 #include <functional>
27 
28 // Original included files, if any
29 
30 #include "device/include/interop.h"
31 #include "osi/include/list.h"
32 #include "types/raw_address.h"
33 
34 // Original usings
35 
36 // Mocked compile conditionals, if any
37 
38 namespace test {
39 namespace mock {
40 namespace device_interop {
41 
42 // Shared state between mocked functions and tests
43 // Name: interop_database_add
44 // Params: const uint16_t feature, const RawAddress* addr, size_t length
45 // Return: void
46 struct interop_database_add {
47   std::function<void(const uint16_t feature, const RawAddress* addr, size_t length)> body{
48           [](const uint16_t /* feature */, const RawAddress* /* addr */, size_t /* length */) {}};
operatorinterop_database_add49   void operator()(const uint16_t feature, const RawAddress* addr, size_t length) {
50     body(feature, addr, length);
51   }
52 };
53 extern struct interop_database_add interop_database_add;
54 
55 // Name: interop_database_add_addr
56 // Params: const uint16_t feature, const RawAddress* addr, size_t length
57 // Return: void
58 struct interop_database_add_addr {
59   std::function<void(const uint16_t feature, const RawAddress* addr, size_t length)> body{
60           [](const uint16_t /* feature */, const RawAddress* /* addr */, size_t /* length */) {}};
operatorinterop_database_add_addr61   void operator()(const uint16_t feature, const RawAddress* addr, size_t length) {
62     body(feature, addr, length);
63   }
64 };
65 extern struct interop_database_add_addr interop_database_add_addr;
66 
67 // Name: interop_database_add_addr_lmp_version
68 // Params: const interop_feature_t feature, const RawAddress* addr, uint8_t
69 // lmp_ver, uint16_t lmp_sub_ver Return: void
70 struct interop_database_add_addr_lmp_version {
71   std::function<void(const interop_feature_t feature, const RawAddress* addr, uint8_t lmp_ver,
72                      uint16_t lmp_sub_ver)>
73           body{[](const interop_feature_t /* feature */, const RawAddress* /* addr */,
74                   uint8_t /* lmp_ver */, uint16_t /* lmp_sub_ver */) {}};
operatorinterop_database_add_addr_lmp_version75   void operator()(const interop_feature_t feature, const RawAddress* addr, uint8_t lmp_ver,
76                   uint16_t lmp_sub_ver) {
77     body(feature, addr, lmp_ver, lmp_sub_ver);
78   }
79 };
80 extern struct interop_database_add_addr_lmp_version interop_database_add_addr_lmp_version;
81 
82 // Name: interop_database_add_addr_max_lat
83 // Params: const interop_feature_t feature, const RawAddress* addr, uint16_t
84 // max_lat Return: void
85 struct interop_database_add_addr_max_lat {
86   std::function<void(const interop_feature_t feature, const RawAddress* addr, uint16_t max_lat)>
87           body{[](const interop_feature_t /* feature */, const RawAddress* /* addr */,
88                   uint16_t /* max_lat */) {}};
operatorinterop_database_add_addr_max_lat89   void operator()(const interop_feature_t feature, const RawAddress* addr, uint16_t max_lat) {
90     body(feature, addr, max_lat);
91   }
92 };
93 extern struct interop_database_add_addr_max_lat interop_database_add_addr_max_lat;
94 
95 // Name: interop_database_add_manufacturer
96 // Params: const interop_feature_t feature, uint16_t manufacturer
97 // Return: void
98 struct interop_database_add_manufacturer {
99   std::function<void(const interop_feature_t feature, uint16_t manufacturer)> body{
100           [](const interop_feature_t /* feature */, uint16_t /* manufacturer */) {}};
operatorinterop_database_add_manufacturer101   void operator()(const interop_feature_t feature, uint16_t manufacturer) {
102     body(feature, manufacturer);
103   }
104 };
105 extern struct interop_database_add_manufacturer interop_database_add_manufacturer;
106 
107 // Name: interop_database_add_name
108 // Params: const uint16_t feature, const char* name
109 // Return: void
110 struct interop_database_add_name {
111   std::function<void(const uint16_t feature, const char* name)> body{
112           [](const uint16_t /* feature */, const char* /* name */) {}};
operatorinterop_database_add_name113   void operator()(const uint16_t feature, const char* name) { body(feature, name); }
114 };
115 extern struct interop_database_add_name interop_database_add_name;
116 
117 // Name: interop_database_add_version
118 // Params: const interop_feature_t feature, uint16_t version
119 // Return: void
120 struct interop_database_add_version {
121   std::function<void(const interop_feature_t feature, uint16_t version)> body{
122           [](const interop_feature_t /* feature */, uint16_t /* version */) {}};
operatorinterop_database_add_version123   void operator()(const interop_feature_t feature, uint16_t version) { body(feature, version); }
124 };
125 extern struct interop_database_add_version interop_database_add_version;
126 
127 // Name: interop_database_add_vndr_prdt
128 // Params: const interop_feature_t feature, uint16_t vendor_id, uint16_t
129 // product_id Return: void
130 struct interop_database_add_vndr_prdt {
131   std::function<void(const interop_feature_t feature, uint16_t vendor_id, uint16_t product_id)>
132           body{[](const interop_feature_t /* feature */, uint16_t /* vendor_id */,
133                   uint16_t /* product_id */) {}};
operatorinterop_database_add_vndr_prdt134   void operator()(const interop_feature_t feature, uint16_t vendor_id, uint16_t product_id) {
135     body(feature, vendor_id, product_id);
136   }
137 };
138 extern struct interop_database_add_vndr_prdt interop_database_add_vndr_prdt;
139 
140 // Name: interop_database_clear
141 // Params:
142 // Return: void
143 struct interop_database_clear {
144   std::function<void()> body{[]() {}};
operatorinterop_database_clear145   void operator()() { body(); }
146 };
147 extern struct interop_database_clear interop_database_clear;
148 
149 // Name: interop_database_match_addr
150 // Params: const interop_feature_t feature, const RawAddress* addr
151 // Return: bool
152 struct interop_database_match_addr {
153   static bool return_value;
154   std::function<bool(const interop_feature_t feature, const RawAddress* addr)> body{
155           [](const interop_feature_t /* feature */, const RawAddress* /* addr */) {
156             return return_value;
157           }};
operatorinterop_database_match_addr158   bool operator()(const interop_feature_t feature, const RawAddress* addr) {
159     return body(feature, addr);
160   }
161 };
162 extern struct interop_database_match_addr interop_database_match_addr;
163 
164 // Name: interop_database_match_addr_get_lmp_ver
165 // Params: const interop_feature_t feature, const RawAddress* addr, uint8_t*
166 // lmp_ver, uint16_t* lmp_sub_ver Return: bool
167 struct interop_database_match_addr_get_lmp_ver {
168   static bool return_value;
169   std::function<bool(const interop_feature_t feature, const RawAddress* addr, uint8_t* lmp_ver,
170                      uint16_t* lmp_sub_ver)>
171           body{[](const interop_feature_t /* feature */, const RawAddress* /* addr */,
172                   uint8_t* /* lmp_ver */, uint16_t* /* lmp_sub_ver */) { return return_value; }};
operatorinterop_database_match_addr_get_lmp_ver173   bool operator()(const interop_feature_t feature, const RawAddress* addr, uint8_t* lmp_ver,
174                   uint16_t* lmp_sub_ver) {
175     return body(feature, addr, lmp_ver, lmp_sub_ver);
176   }
177 };
178 extern struct interop_database_match_addr_get_lmp_ver interop_database_match_addr_get_lmp_ver;
179 
180 // Name: interop_database_match_addr_get_max_lat
181 // Params: const interop_feature_t feature, const RawAddress* addr, uint16_t*
182 // max_lat Return: bool
183 struct interop_database_match_addr_get_max_lat {
184   static bool return_value;
185   std::function<bool(const interop_feature_t feature, const RawAddress* addr, uint16_t* max_lat)>
186           body{[](const interop_feature_t /* feature */, const RawAddress* /* addr */,
187                   uint16_t* /* max_lat */) { return return_value; }};
operatorinterop_database_match_addr_get_max_lat188   bool operator()(const interop_feature_t feature, const RawAddress* addr, uint16_t* max_lat) {
189     return body(feature, addr, max_lat);
190   }
191 };
192 extern struct interop_database_match_addr_get_max_lat interop_database_match_addr_get_max_lat;
193 
194 // Name: interop_database_match_manufacturer
195 // Params: const interop_feature_t feature, uint16_t manufacturer
196 // Return: bool
197 struct interop_database_match_manufacturer {
198   static bool return_value;
199   std::function<bool(const interop_feature_t feature, uint16_t manufacturer)> body{
200           [](const interop_feature_t /* feature */, uint16_t /* manufacturer */) {
201             return return_value;
202           }};
operatorinterop_database_match_manufacturer203   bool operator()(const interop_feature_t feature, uint16_t manufacturer) {
204     return body(feature, manufacturer);
205   }
206 };
207 extern struct interop_database_match_manufacturer interop_database_match_manufacturer;
208 
209 // Name: interop_database_match_name
210 // Params: const interop_feature_t feature, const char* name
211 // Return: bool
212 struct interop_database_match_name {
213   static bool return_value;
214   std::function<bool(const interop_feature_t feature, const char* name)> body{
215           [](const interop_feature_t /* feature */, const char* /* name */) {
216             return return_value;
217           }};
operatorinterop_database_match_name218   bool operator()(const interop_feature_t feature, const char* name) { return body(feature, name); }
219 };
220 extern struct interop_database_match_name interop_database_match_name;
221 
222 // Name: interop_database_match_version
223 // Params: const interop_feature_t feature, uint16_t version
224 // Return: bool
225 struct interop_database_match_version {
226   static bool return_value;
227   std::function<bool(const interop_feature_t feature, uint16_t version)> body{
228           [](const interop_feature_t /* feature */, uint16_t /* version */) {
229             return return_value;
230           }};
operatorinterop_database_match_version231   bool operator()(const interop_feature_t feature, uint16_t version) {
232     return body(feature, version);
233   }
234 };
235 extern struct interop_database_match_version interop_database_match_version;
236 
237 // Name: interop_database_match_vndr_prdt
238 // Params: const interop_feature_t feature, uint16_t vendor_id, uint16_t
239 // product_id Return: bool
240 struct interop_database_match_vndr_prdt {
241   static bool return_value;
242   std::function<bool(const interop_feature_t feature, uint16_t vendor_id, uint16_t product_id)>
243           body{[](const interop_feature_t /* feature */, uint16_t /* vendor_id */,
244                   uint16_t /* product_id */) { return return_value; }};
operatorinterop_database_match_vndr_prdt245   bool operator()(const interop_feature_t feature, uint16_t vendor_id, uint16_t product_id) {
246     return body(feature, vendor_id, product_id);
247   }
248 };
249 extern struct interop_database_match_vndr_prdt interop_database_match_vndr_prdt;
250 
251 // Name: interop_database_remove_addr
252 // Params: const interop_feature_t feature, const RawAddress* addr
253 // Return: bool
254 struct interop_database_remove_addr {
255   static bool return_value;
256   std::function<bool(const interop_feature_t feature, const RawAddress* addr)> body{
257           [](const interop_feature_t /* feature */, const RawAddress* /* addr */) {
258             return return_value;
259           }};
operatorinterop_database_remove_addr260   bool operator()(const interop_feature_t feature, const RawAddress* addr) {
261     return body(feature, addr);
262   }
263 };
264 extern struct interop_database_remove_addr interop_database_remove_addr;
265 
266 // Name: interop_database_remove_addr_lmp_version
267 // Params: const interop_feature_t feature, const RawAddress* addr, uint8_t
268 // lmp_ver, uint16_t lmp_sub_ver Return: bool
269 struct interop_database_remove_addr_lmp_version {
270   static bool return_value;
271   std::function<bool(const interop_feature_t feature, const RawAddress* addr, uint8_t lmp_ver,
272                      uint16_t lmp_sub_ver)>
273           body{[](const interop_feature_t /* feature */, const RawAddress* /* addr */,
274                   uint8_t /* lmp_ver */, uint16_t /* lmp_sub_ver */) { return return_value; }};
operatorinterop_database_remove_addr_lmp_version275   bool operator()(const interop_feature_t feature, const RawAddress* addr, uint8_t lmp_ver,
276                   uint16_t lmp_sub_ver) {
277     return body(feature, addr, lmp_ver, lmp_sub_ver);
278   }
279 };
280 extern struct interop_database_remove_addr_lmp_version interop_database_remove_addr_lmp_version;
281 
282 // Name: interop_database_remove_addr_max_lat
283 // Params: const interop_feature_t feature, const RawAddress* addr, uint16_t
284 // max_lat Return: bool
285 struct interop_database_remove_addr_max_lat {
286   static bool return_value;
287   std::function<bool(const interop_feature_t feature, const RawAddress* addr, uint16_t max_lat)>
288           body{[](const interop_feature_t /* feature */, const RawAddress* /* addr */,
289                   uint16_t /* max_lat */) { return return_value; }};
operatorinterop_database_remove_addr_max_lat290   bool operator()(const interop_feature_t feature, const RawAddress* addr, uint16_t max_lat) {
291     return body(feature, addr, max_lat);
292   }
293 };
294 extern struct interop_database_remove_addr_max_lat interop_database_remove_addr_max_lat;
295 
296 // Name: interop_database_remove_feature
297 // Params: const interop_feature_t feature
298 // Return: bool
299 struct interop_database_remove_feature {
300   static bool return_value;
301   std::function<bool(const interop_feature_t feature)> body{
302           [](const interop_feature_t /* feature */) { return return_value; }};
operatorinterop_database_remove_feature303   bool operator()(const interop_feature_t feature) { return body(feature); }
304 };
305 extern struct interop_database_remove_feature interop_database_remove_feature;
306 
307 // Name: interop_database_remove_manufacturer
308 // Params: const interop_feature_t feature, uint16_t manufacturer
309 // Return: bool
310 struct interop_database_remove_manufacturer {
311   static bool return_value;
312   std::function<bool(const interop_feature_t feature, uint16_t manufacturer)> body{
313           [](const interop_feature_t /* feature */, uint16_t /* manufacturer */) {
314             return return_value;
315           }};
operatorinterop_database_remove_manufacturer316   bool operator()(const interop_feature_t feature, uint16_t manufacturer) {
317     return body(feature, manufacturer);
318   }
319 };
320 extern struct interop_database_remove_manufacturer interop_database_remove_manufacturer;
321 
322 // Name: interop_database_remove_name
323 // Params: const interop_feature_t feature, const char* name
324 // Return: bool
325 struct interop_database_remove_name {
326   static bool return_value;
327   std::function<bool(const interop_feature_t feature, const char* name)> body{
328           [](const interop_feature_t /* feature */, const char* /* name */) {
329             return return_value;
330           }};
operatorinterop_database_remove_name331   bool operator()(const interop_feature_t feature, const char* name) { return body(feature, name); }
332 };
333 extern struct interop_database_remove_name interop_database_remove_name;
334 
335 // Name: interop_database_remove_version
336 // Params: const interop_feature_t feature, uint16_t version
337 // Return: bool
338 struct interop_database_remove_version {
339   static bool return_value;
340   std::function<bool(const interop_feature_t feature, uint16_t version)> body{
341           [](const interop_feature_t /* feature */, uint16_t /* version */) {
342             return return_value;
343           }};
operatorinterop_database_remove_version344   bool operator()(const interop_feature_t feature, uint16_t version) {
345     return body(feature, version);
346   }
347 };
348 extern struct interop_database_remove_version interop_database_remove_version;
349 
350 // Name: interop_database_remove_vndr_prdt
351 // Params: const interop_feature_t feature, uint16_t vendor_id, uint16_t
352 // product_id Return: bool
353 struct interop_database_remove_vndr_prdt {
354   static bool return_value;
355   std::function<bool(const interop_feature_t feature, uint16_t vendor_id, uint16_t product_id)>
356           body{[](const interop_feature_t /* feature */, uint16_t /* vendor_id */,
357                   uint16_t /* product_id */) { return return_value; }};
operatorinterop_database_remove_vndr_prdt358   bool operator()(const interop_feature_t feature, uint16_t vendor_id, uint16_t product_id) {
359     return body(feature, vendor_id, product_id);
360   }
361 };
362 extern struct interop_database_remove_vndr_prdt interop_database_remove_vndr_prdt;
363 
364 // Name: interop_feature_name_to_feature_id
365 // Params: const char* feature_name
366 // Return: int
367 struct interop_feature_name_to_feature_id {
368   static int return_value;
369   std::function<int(const char* feature_name)> body{
370           [](const char* /* feature_name */) { return return_value; }};
operatorinterop_feature_name_to_feature_id371   int operator()(const char* feature_name) { return body(feature_name); }
372 };
373 extern struct interop_feature_name_to_feature_id interop_feature_name_to_feature_id;
374 
375 // Name: interop_match_addr
376 // Params: const interop_feature_t feature, const RawAddress* addr
377 // Return: bool
378 struct interop_match_addr {
379   static bool return_value;
380   std::function<bool(const interop_feature_t feature, const RawAddress* addr)> body{
381           [](const interop_feature_t /* feature */, const RawAddress* /* addr */) {
382             return return_value;
383           }};
operatorinterop_match_addr384   bool operator()(const interop_feature_t feature, const RawAddress* addr) {
385     return body(feature, addr);
386   }
387 };
388 extern struct interop_match_addr interop_match_addr;
389 
390 // Name: interop_match_addr_get_max_lat
391 // Params: const interop_feature_t feature, const RawAddress* addr, uint16_t*
392 // max_lat Return: bool
393 struct interop_match_addr_get_max_lat {
394   static bool return_value;
395   std::function<bool(const interop_feature_t feature, const RawAddress* addr, uint16_t* max_lat)>
396           body{[](const interop_feature_t /* feature */, const RawAddress* /* addr */,
397                   uint16_t* /* max_lat */) { return return_value; }};
operatorinterop_match_addr_get_max_lat398   bool operator()(const interop_feature_t feature, const RawAddress* addr, uint16_t* max_lat) {
399     return body(feature, addr, max_lat);
400   }
401 };
402 extern struct interop_match_addr_get_max_lat interop_match_addr_get_max_lat;
403 
404 // Name: interop_match_addr_or_name
405 // Params: const interop_feature_t feature, const RawAddress* addr, bt_status_t
406 // (*get_remote_device_property Return: bool
407 struct interop_match_addr_or_name {
408   static bool return_value;
409   std::function<bool(const interop_feature_t feature, const RawAddress* addr,
410                      bt_status_t (*get_remote_device_property)(const RawAddress*, bt_property_t*))>
411           body{[](const interop_feature_t /* feature */, const RawAddress* /* addr */,
412                   bt_status_t (* /* get_remote_device_property */)(
413                           const RawAddress*, bt_property_t*)) { return return_value; }};
operatorinterop_match_addr_or_name414   bool operator()(const interop_feature_t feature, const RawAddress* addr,
415                   bt_status_t (*get_remote_device_property)(const RawAddress*, bt_property_t*)) {
416     return body(feature, addr, get_remote_device_property);
417   }
418 };
419 extern struct interop_match_addr_or_name interop_match_addr_or_name;
420 
421 // Name: interop_match_manufacturer
422 // Params: const interop_feature_t feature, uint16_t manufacturer
423 // Return: bool
424 struct interop_match_manufacturer {
425   static bool return_value;
426   std::function<bool(const interop_feature_t feature, uint16_t manufacturer)> body{
427           [](const interop_feature_t /* feature */, uint16_t /* manufacturer */) {
428             return return_value;
429           }};
operatorinterop_match_manufacturer430   bool operator()(const interop_feature_t feature, uint16_t manufacturer) {
431     return body(feature, manufacturer);
432   }
433 };
434 extern struct interop_match_manufacturer interop_match_manufacturer;
435 
436 // Name: interop_match_name
437 // Params: const interop_feature_t feature, const char* name
438 // Return: bool
439 struct interop_match_name {
440   static bool return_value;
441   std::function<bool(const interop_feature_t feature, const char* name)> body{
442           [](const interop_feature_t /* feature */, const char* /* name */) {
443             return return_value;
444           }};
operatorinterop_match_name445   bool operator()(const interop_feature_t feature, const char* name) { return body(feature, name); }
446 };
447 extern struct interop_match_name interop_match_name;
448 
449 // Name: interop_match_vendor_product_ids
450 // Params: const interop_feature_t feature, uint16_t vendor_id, uint16_t
451 // product_id Return: bool
452 struct interop_match_vendor_product_ids {
453   static bool return_value;
454   std::function<bool(const interop_feature_t feature, uint16_t vendor_id, uint16_t product_id)>
455           body{[](const interop_feature_t /* feature */, uint16_t /* vendor_id */,
456                   uint16_t /* product_id */) { return return_value; }};
operatorinterop_match_vendor_product_ids457   bool operator()(const interop_feature_t feature, uint16_t vendor_id, uint16_t product_id) {
458     return body(feature, vendor_id, product_id);
459   }
460 };
461 extern struct interop_match_vendor_product_ids interop_match_vendor_product_ids;
462 
463 // Name: token_to_ul
464 // Params: char* token, uint16_t* ul
465 // Return: bool
466 struct token_to_ul {
467   static bool return_value;
468   std::function<bool(char* token, uint16_t* ul)> body{
469           [](char* /* token */, uint16_t* /* ul */) { return return_value; }};
operatortoken_to_ul470   bool operator()(char* token, uint16_t* ul) { return body(token, ul); }
471 };
472 extern struct token_to_ul token_to_ul;
473 
474 }  // namespace device_interop
475 }  // namespace mock
476 }  // namespace test
477 
478 // END mockcify generation
479