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:34
19  *
20  *  mockcify.pl ver 0.6.2
21  */
22 // Mock include file to share data between tests and mock
23 #include "test/mock/mock_device_interop.h"
24 
25 #include <cstdint>
26 
27 #include "device/include/interop.h"
28 #include "test/common/mock_functions.h"
29 
30 // Original usings
31 
32 // Mocked internal structures, if any
33 
34 namespace test {
35 namespace mock {
36 namespace device_interop {
37 
38 // Function state capture and return values, if needed
39 struct interop_database_add interop_database_add;
40 struct interop_database_add_addr interop_database_add_addr;
41 struct interop_database_add_addr_lmp_version
42     interop_database_add_addr_lmp_version;
43 struct interop_database_add_addr_max_lat interop_database_add_addr_max_lat;
44 struct interop_database_add_manufacturer interop_database_add_manufacturer;
45 struct interop_database_add_name interop_database_add_name;
46 struct interop_database_add_version interop_database_add_version;
47 struct interop_database_add_vndr_prdt interop_database_add_vndr_prdt;
48 struct interop_database_clear interop_database_clear;
49 struct interop_database_match_addr interop_database_match_addr;
50 struct interop_database_match_addr_get_lmp_ver
51     interop_database_match_addr_get_lmp_ver;
52 struct interop_database_match_addr_get_max_lat
53     interop_database_match_addr_get_max_lat;
54 struct interop_database_match_manufacturer interop_database_match_manufacturer;
55 struct interop_database_match_name interop_database_match_name;
56 struct interop_database_match_version interop_database_match_version;
57 struct interop_database_match_vndr_prdt interop_database_match_vndr_prdt;
58 struct interop_database_remove_addr interop_database_remove_addr;
59 struct interop_database_remove_addr_lmp_version
60     interop_database_remove_addr_lmp_version;
61 struct interop_database_remove_addr_max_lat
62     interop_database_remove_addr_max_lat;
63 struct interop_database_remove_feature interop_database_remove_feature;
64 struct interop_database_remove_manufacturer
65     interop_database_remove_manufacturer;
66 struct interop_database_remove_name interop_database_remove_name;
67 struct interop_database_remove_version interop_database_remove_version;
68 struct interop_database_remove_vndr_prdt interop_database_remove_vndr_prdt;
69 struct interop_feature_name_to_feature_id interop_feature_name_to_feature_id;
70 struct interop_match_addr interop_match_addr;
71 struct interop_match_addr_get_max_lat interop_match_addr_get_max_lat;
72 struct interop_match_addr_or_name interop_match_addr_or_name;
73 struct interop_match_manufacturer interop_match_manufacturer;
74 struct interop_match_name interop_match_name;
75 struct interop_match_vendor_product_ids interop_match_vendor_product_ids;
76 struct token_to_ul token_to_ul;
77 
78 }  // namespace device_interop
79 }  // namespace mock
80 }  // namespace test
81 
82 // Mocked function return values, if any
83 namespace test {
84 namespace mock {
85 namespace device_interop {
86 
87 bool interop_database_match_addr::return_value = false;
88 bool interop_database_match_addr_get_lmp_ver::return_value = false;
89 bool interop_database_match_addr_get_max_lat::return_value = false;
90 bool interop_database_match_manufacturer::return_value = false;
91 bool interop_database_match_name::return_value = false;
92 bool interop_database_match_version::return_value = false;
93 bool interop_database_match_vndr_prdt::return_value = false;
94 bool interop_database_remove_addr::return_value = false;
95 bool interop_database_remove_addr_lmp_version::return_value = false;
96 bool interop_database_remove_addr_max_lat::return_value = false;
97 bool interop_database_remove_feature::return_value = false;
98 bool interop_database_remove_manufacturer::return_value = false;
99 bool interop_database_remove_name::return_value = false;
100 bool interop_database_remove_version::return_value = false;
101 bool interop_database_remove_vndr_prdt::return_value = false;
102 int interop_feature_name_to_feature_id::return_value = 0;
103 bool interop_match_addr::return_value = false;
104 bool interop_match_addr_get_max_lat::return_value = false;
105 bool interop_match_addr_or_name::return_value = false;
106 bool interop_match_manufacturer::return_value = false;
107 bool interop_match_name::return_value = false;
108 bool interop_match_vendor_product_ids::return_value = false;
109 bool token_to_ul::return_value = false;
110 
111 }  // namespace device_interop
112 }  // namespace mock
113 }  // namespace test
114 
115 // Mocked functions, if any
interop_database_add(const uint16_t feature,const RawAddress * addr,size_t length)116 void interop_database_add(const uint16_t feature, const RawAddress* addr,
117                           size_t length) {
118   inc_func_call_count(__func__);
119   test::mock::device_interop::interop_database_add(feature, addr, length);
120 }
interop_database_add_addr(const uint16_t feature,const RawAddress * addr,size_t length)121 void interop_database_add_addr(const uint16_t feature, const RawAddress* addr,
122                                size_t length) {
123   inc_func_call_count(__func__);
124   test::mock::device_interop::interop_database_add_addr(feature, addr, length);
125 }
interop_database_add_addr_lmp_version(const interop_feature_t feature,const RawAddress * addr,uint8_t lmp_ver,uint16_t lmp_sub_ver)126 void interop_database_add_addr_lmp_version(const interop_feature_t feature,
127                                            const RawAddress* addr,
128                                            uint8_t lmp_ver,
129                                            uint16_t lmp_sub_ver) {
130   inc_func_call_count(__func__);
131   test::mock::device_interop::interop_database_add_addr_lmp_version(
132       feature, addr, lmp_ver, lmp_sub_ver);
133 }
interop_database_add_addr_max_lat(const interop_feature_t feature,const RawAddress * addr,uint16_t max_lat)134 void interop_database_add_addr_max_lat(const interop_feature_t feature,
135                                        const RawAddress* addr,
136                                        uint16_t max_lat) {
137   inc_func_call_count(__func__);
138   test::mock::device_interop::interop_database_add_addr_max_lat(feature, addr,
139                                                                 max_lat);
140 }
interop_database_add_manufacturer(const interop_feature_t feature,uint16_t manufacturer)141 void interop_database_add_manufacturer(const interop_feature_t feature,
142                                        uint16_t manufacturer) {
143   inc_func_call_count(__func__);
144   test::mock::device_interop::interop_database_add_manufacturer(feature,
145                                                                 manufacturer);
146 }
interop_database_add_name(const uint16_t feature,const char * name)147 void interop_database_add_name(const uint16_t feature, const char* name) {
148   inc_func_call_count(__func__);
149   test::mock::device_interop::interop_database_add_name(feature, name);
150 }
interop_database_add_version(const interop_feature_t feature,uint16_t version)151 void interop_database_add_version(const interop_feature_t feature,
152                                   uint16_t version) {
153   inc_func_call_count(__func__);
154   test::mock::device_interop::interop_database_add_version(feature, version);
155 }
interop_database_add_vndr_prdt(const interop_feature_t feature,uint16_t vendor_id,uint16_t product_id)156 void interop_database_add_vndr_prdt(const interop_feature_t feature,
157                                     uint16_t vendor_id, uint16_t product_id) {
158   inc_func_call_count(__func__);
159   test::mock::device_interop::interop_database_add_vndr_prdt(feature, vendor_id,
160                                                              product_id);
161 }
interop_database_clear()162 void interop_database_clear() {
163   inc_func_call_count(__func__);
164   test::mock::device_interop::interop_database_clear();
165 }
interop_database_match_addr(const interop_feature_t feature,const RawAddress * addr)166 bool interop_database_match_addr(const interop_feature_t feature,
167                                  const RawAddress* addr) {
168   inc_func_call_count(__func__);
169   return test::mock::device_interop::interop_database_match_addr(feature, addr);
170 }
interop_database_match_addr_get_lmp_ver(const interop_feature_t feature,const RawAddress * addr,uint8_t * lmp_ver,uint16_t * lmp_sub_ver)171 bool interop_database_match_addr_get_lmp_ver(const interop_feature_t feature,
172                                              const RawAddress* addr,
173                                              uint8_t* lmp_ver,
174                                              uint16_t* lmp_sub_ver) {
175   inc_func_call_count(__func__);
176   return test::mock::device_interop::interop_database_match_addr_get_lmp_ver(
177       feature, addr, lmp_ver, lmp_sub_ver);
178 }
interop_database_match_addr_get_max_lat(const interop_feature_t feature,const RawAddress * addr,uint16_t * max_lat)179 bool interop_database_match_addr_get_max_lat(const interop_feature_t feature,
180                                              const RawAddress* addr,
181                                              uint16_t* max_lat) {
182   inc_func_call_count(__func__);
183   return test::mock::device_interop::interop_database_match_addr_get_max_lat(
184       feature, addr, max_lat);
185 }
interop_database_match_manufacturer(const interop_feature_t feature,uint16_t manufacturer)186 bool interop_database_match_manufacturer(const interop_feature_t feature,
187                                          uint16_t manufacturer) {
188   inc_func_call_count(__func__);
189   return test::mock::device_interop::interop_database_match_manufacturer(
190       feature, manufacturer);
191 }
interop_database_match_name(const interop_feature_t feature,const char * name)192 bool interop_database_match_name(const interop_feature_t feature,
193                                  const char* name) {
194   inc_func_call_count(__func__);
195   return test::mock::device_interop::interop_database_match_name(feature, name);
196 }
interop_database_match_version(const interop_feature_t feature,uint16_t version)197 bool interop_database_match_version(const interop_feature_t feature,
198                                     uint16_t version) {
199   inc_func_call_count(__func__);
200   return test::mock::device_interop::interop_database_match_version(feature,
201                                                                     version);
202 }
interop_database_match_vndr_prdt(const interop_feature_t feature,uint16_t vendor_id,uint16_t product_id)203 bool interop_database_match_vndr_prdt(const interop_feature_t feature,
204                                       uint16_t vendor_id, uint16_t product_id) {
205   inc_func_call_count(__func__);
206   return test::mock::device_interop::interop_database_match_vndr_prdt(
207       feature, vendor_id, product_id);
208 }
interop_database_remove_addr(const interop_feature_t feature,const RawAddress * addr)209 bool interop_database_remove_addr(const interop_feature_t feature,
210                                   const RawAddress* addr) {
211   inc_func_call_count(__func__);
212   return test::mock::device_interop::interop_database_remove_addr(feature,
213                                                                   addr);
214 }
interop_database_remove_addr_lmp_version(const interop_feature_t feature,const RawAddress * addr,uint8_t lmp_ver,uint16_t lmp_sub_ver)215 bool interop_database_remove_addr_lmp_version(const interop_feature_t feature,
216                                               const RawAddress* addr,
217                                               uint8_t lmp_ver,
218                                               uint16_t lmp_sub_ver) {
219   inc_func_call_count(__func__);
220   return test::mock::device_interop::interop_database_remove_addr_lmp_version(
221       feature, addr, lmp_ver, lmp_sub_ver);
222 }
interop_database_remove_addr_max_lat(const interop_feature_t feature,const RawAddress * addr,uint16_t max_lat)223 bool interop_database_remove_addr_max_lat(const interop_feature_t feature,
224                                           const RawAddress* addr,
225                                           uint16_t max_lat) {
226   inc_func_call_count(__func__);
227   return test::mock::device_interop::interop_database_remove_addr_max_lat(
228       feature, addr, max_lat);
229 }
interop_database_remove_feature(const interop_feature_t feature)230 bool interop_database_remove_feature(const interop_feature_t feature) {
231   inc_func_call_count(__func__);
232   return test::mock::device_interop::interop_database_remove_feature(feature);
233 }
interop_database_remove_manufacturer(const interop_feature_t feature,uint16_t manufacturer)234 bool interop_database_remove_manufacturer(const interop_feature_t feature,
235                                           uint16_t manufacturer) {
236   inc_func_call_count(__func__);
237   return test::mock::device_interop::interop_database_remove_manufacturer(
238       feature, manufacturer);
239 }
interop_database_remove_name(const interop_feature_t feature,const char * name)240 bool interop_database_remove_name(const interop_feature_t feature,
241                                   const char* name) {
242   inc_func_call_count(__func__);
243   return test::mock::device_interop::interop_database_remove_name(feature,
244                                                                   name);
245 }
interop_database_remove_version(const interop_feature_t feature,uint16_t version)246 bool interop_database_remove_version(const interop_feature_t feature,
247                                      uint16_t version) {
248   inc_func_call_count(__func__);
249   return test::mock::device_interop::interop_database_remove_version(feature,
250                                                                      version);
251 }
interop_database_remove_vndr_prdt(const interop_feature_t feature,uint16_t vendor_id,uint16_t product_id)252 bool interop_database_remove_vndr_prdt(const interop_feature_t feature,
253                                        uint16_t vendor_id,
254                                        uint16_t product_id) {
255   inc_func_call_count(__func__);
256   return test::mock::device_interop::interop_database_remove_vndr_prdt(
257       feature, vendor_id, product_id);
258 }
interop_feature_name_to_feature_id(const char * feature_name)259 int interop_feature_name_to_feature_id(const char* feature_name) {
260   inc_func_call_count(__func__);
261   return test::mock::device_interop::interop_feature_name_to_feature_id(
262       feature_name);
263 }
interop_match_addr(const interop_feature_t feature,const RawAddress * addr)264 bool interop_match_addr(const interop_feature_t feature,
265                         const RawAddress* addr) {
266   inc_func_call_count(__func__);
267   return test::mock::device_interop::interop_match_addr(feature, addr);
268 }
interop_match_addr_get_max_lat(const interop_feature_t feature,const RawAddress * addr,uint16_t * max_lat)269 bool interop_match_addr_get_max_lat(const interop_feature_t feature,
270                                     const RawAddress* addr, uint16_t* max_lat) {
271   inc_func_call_count(__func__);
272   return test::mock::device_interop::interop_match_addr_get_max_lat(
273       feature, addr, max_lat);
274 }
interop_match_addr_or_name(const interop_feature_t feature,const RawAddress * addr,bt_status_t (* get_remote_device_property)(const RawAddress *,bt_property_t *))275 bool interop_match_addr_or_name(const interop_feature_t feature,
276                                 const RawAddress* addr,
277                                 bt_status_t (*get_remote_device_property)(
278                                     const RawAddress*, bt_property_t*)) {
279   inc_func_call_count(__func__);
280   return test::mock::device_interop::interop_match_addr_or_name(
281       feature, addr, get_remote_device_property);
282 }
interop_match_manufacturer(const interop_feature_t feature,uint16_t manufacturer)283 bool interop_match_manufacturer(const interop_feature_t feature,
284                                 uint16_t manufacturer) {
285   inc_func_call_count(__func__);
286   return test::mock::device_interop::interop_match_manufacturer(feature,
287                                                                 manufacturer);
288 }
interop_match_name(const interop_feature_t feature,const char * name)289 bool interop_match_name(const interop_feature_t feature, const char* name) {
290   inc_func_call_count(__func__);
291   return test::mock::device_interop::interop_match_name(feature, name);
292 }
interop_match_vendor_product_ids(const interop_feature_t feature,uint16_t vendor_id,uint16_t product_id)293 bool interop_match_vendor_product_ids(const interop_feature_t feature,
294                                       uint16_t vendor_id, uint16_t product_id) {
295   inc_func_call_count(__func__);
296   return test::mock::device_interop::interop_match_vendor_product_ids(
297       feature, vendor_id, product_id);
298 }
token_to_ul(char * token,uint16_t * ul)299 bool token_to_ul(char* token, uint16_t* ul) {
300   inc_func_call_count(__func__);
301   return test::mock::device_interop::token_to_ul(token, ul);
302 }
303 // Mocked functions complete
304 // END mockcify generation
305