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:43
19 *
20 * mockcify.pl ver 0.6.0
21 */
22 // Mock include file to share data between tests and mock
23 #include "test/mock/mock_stack_btm_inq.h"
24
25 #include <cstdint>
26
27 #include "test/common/mock_functions.h"
28
29 // Original usings
30
31 // Mocked internal structures, if any
32
33 namespace test {
34 namespace mock {
35 namespace stack_btm_inq {
36
37 // Function state capture and return values, if needed
38 struct BTM_AddEirService BTM_AddEirService;
39 struct BTM_CancelInquiry BTM_CancelInquiry;
40 struct BTM_CancelRemoteDeviceName BTM_CancelRemoteDeviceName;
41 struct BTM_ClearInqDb BTM_ClearInqDb;
42 struct BTM_EnableInterlacedInquiryScan BTM_EnableInterlacedInquiryScan;
43 struct BTM_EnableInterlacedPageScan BTM_EnableInterlacedPageScan;
44 struct BTM_GetEirSupportedServices BTM_GetEirSupportedServices;
45 struct BTM_GetEirUuidList BTM_GetEirUuidList;
46 struct BTM_HasEirService BTM_HasEirService;
47 struct BTM_InqDbFirst BTM_InqDbFirst;
48 struct BTM_InqDbNext BTM_InqDbNext;
49 struct BTM_InqDbRead BTM_InqDbRead;
50 struct BTM_IsInquiryActive BTM_IsInquiryActive;
51 struct BTM_ReadRemoteDeviceName BTM_ReadRemoteDeviceName;
52 struct BTM_RemoveEirService BTM_RemoveEirService;
53 struct BTM_SetConnectability BTM_SetConnectability;
54 struct BTM_SetDiscoverability BTM_SetDiscoverability;
55 struct BTM_SetInquiryMode BTM_SetInquiryMode;
56 struct BTM_StartInquiry BTM_StartInquiry;
57 struct BTM_WriteEIR BTM_WriteEIR;
58 struct btm_clear_all_pending_le_entry btm_clear_all_pending_le_entry;
59 struct btm_clr_inq_db btm_clr_inq_db;
60 struct btm_clr_inq_result_flt btm_clr_inq_result_flt;
61 struct btm_inq_db_find btm_inq_db_find;
62 struct btm_inq_db_new btm_inq_db_new;
63 struct btm_inq_db_reset btm_inq_db_reset;
64 struct btm_inq_find_bdaddr btm_inq_find_bdaddr;
65 struct btm_inq_remote_name_timer_timeout btm_inq_remote_name_timer_timeout;
66 struct btm_inq_rmt_name_failed_cancelled btm_inq_rmt_name_failed_cancelled;
67 struct btm_process_inq_complete btm_process_inq_complete;
68 struct btm_process_remote_name btm_process_remote_name;
69 struct btm_set_eir_uuid btm_set_eir_uuid;
70 struct btm_sort_inq_result btm_sort_inq_result;
71
72 } // namespace stack_btm_inq
73 } // namespace mock
74 } // namespace test
75
76 // Mocked function return values, if any
77 namespace test {
78 namespace mock {
79 namespace stack_btm_inq {
80
81 tBTM_STATUS BTM_CancelRemoteDeviceName::return_value = 0;
82 tBTM_STATUS BTM_ClearInqDb::return_value = 0;
83 uint8_t BTM_GetEirSupportedServices::return_value = 0;
84 uint8_t BTM_GetEirUuidList::return_value = 0;
85 bool BTM_HasEirService::return_value = false;
86 tBTM_INQ_INFO* BTM_InqDbFirst::return_value = nullptr;
87 tBTM_INQ_INFO* BTM_InqDbNext::return_value = nullptr;
88 tBTM_INQ_INFO* BTM_InqDbRead::return_value = nullptr;
89 uint16_t BTM_IsInquiryActive::return_value = 0;
90 tBTM_STATUS BTM_ReadRemoteDeviceName::return_value = 0;
91 tBTM_STATUS BTM_SetConnectability::return_value = 0;
92 tBTM_STATUS BTM_SetDiscoverability::return_value = 0;
93 tBTM_STATUS BTM_SetInquiryMode::return_value = 0;
94 tBTM_STATUS BTM_StartInquiry::return_value = 0;
95 tBTM_STATUS BTM_WriteEIR::return_value = 0;
96 tINQ_DB_ENT* btm_inq_db_find::return_value = nullptr;
97 tINQ_DB_ENT* btm_inq_db_new::return_value = nullptr;
98 bool btm_inq_find_bdaddr::return_value = false;
99
100 } // namespace stack_btm_inq
101 } // namespace mock
102 } // namespace test
103
104 // Mocked functions, if any
BTM_AddEirService(uint32_t * p_eir_uuid,uint16_t uuid16)105 void BTM_AddEirService(uint32_t* p_eir_uuid, uint16_t uuid16) {
106 inc_func_call_count(__func__);
107 test::mock::stack_btm_inq::BTM_AddEirService(p_eir_uuid, uuid16);
108 }
BTM_CancelInquiry(void)109 void BTM_CancelInquiry(void) {
110 inc_func_call_count(__func__);
111 test::mock::stack_btm_inq::BTM_CancelInquiry();
112 }
BTM_CancelRemoteDeviceName(void)113 tBTM_STATUS BTM_CancelRemoteDeviceName(void) {
114 inc_func_call_count(__func__);
115 return test::mock::stack_btm_inq::BTM_CancelRemoteDeviceName();
116 }
BTM_ClearInqDb(const RawAddress * p_bda)117 tBTM_STATUS BTM_ClearInqDb(const RawAddress* p_bda) {
118 inc_func_call_count(__func__);
119 return test::mock::stack_btm_inq::BTM_ClearInqDb(p_bda);
120 }
BTM_EnableInterlacedInquiryScan()121 void BTM_EnableInterlacedInquiryScan() {
122 inc_func_call_count(__func__);
123 test::mock::stack_btm_inq::BTM_EnableInterlacedInquiryScan();
124 }
BTM_EnableInterlacedPageScan()125 void BTM_EnableInterlacedPageScan() {
126 inc_func_call_count(__func__);
127 test::mock::stack_btm_inq::BTM_EnableInterlacedPageScan();
128 }
BTM_GetEirSupportedServices(uint32_t * p_eir_uuid,uint8_t ** p,uint8_t max_num_uuid16,uint8_t * p_num_uuid16)129 uint8_t BTM_GetEirSupportedServices(uint32_t* p_eir_uuid, uint8_t** p,
130 uint8_t max_num_uuid16,
131 uint8_t* p_num_uuid16) {
132 inc_func_call_count(__func__);
133 return test::mock::stack_btm_inq::BTM_GetEirSupportedServices(
134 p_eir_uuid, p, max_num_uuid16, p_num_uuid16);
135 }
BTM_GetEirUuidList(const uint8_t * p_eir,size_t eir_len,uint8_t uuid_size,uint8_t * p_num_uuid,uint8_t * p_uuid_list,uint8_t max_num_uuid)136 uint8_t BTM_GetEirUuidList(const uint8_t* p_eir, size_t eir_len,
137 uint8_t uuid_size, uint8_t* p_num_uuid,
138 uint8_t* p_uuid_list, uint8_t max_num_uuid) {
139 inc_func_call_count(__func__);
140 return test::mock::stack_btm_inq::BTM_GetEirUuidList(
141 p_eir, eir_len, uuid_size, p_num_uuid, p_uuid_list, max_num_uuid);
142 }
BTM_HasEirService(const uint32_t * p_eir_uuid,uint16_t uuid16)143 bool BTM_HasEirService(const uint32_t* p_eir_uuid, uint16_t uuid16) {
144 inc_func_call_count(__func__);
145 return test::mock::stack_btm_inq::BTM_HasEirService(p_eir_uuid, uuid16);
146 }
BTM_InqDbFirst(void)147 tBTM_INQ_INFO* BTM_InqDbFirst(void) {
148 inc_func_call_count(__func__);
149 return test::mock::stack_btm_inq::BTM_InqDbFirst();
150 }
BTM_InqDbNext(tBTM_INQ_INFO * p_cur)151 tBTM_INQ_INFO* BTM_InqDbNext(tBTM_INQ_INFO* p_cur) {
152 inc_func_call_count(__func__);
153 return test::mock::stack_btm_inq::BTM_InqDbNext(p_cur);
154 }
BTM_InqDbRead(const RawAddress & p_bda)155 tBTM_INQ_INFO* BTM_InqDbRead(const RawAddress& p_bda) {
156 inc_func_call_count(__func__);
157 return test::mock::stack_btm_inq::BTM_InqDbRead(p_bda);
158 }
BTM_IsInquiryActive(void)159 uint16_t BTM_IsInquiryActive(void) {
160 inc_func_call_count(__func__);
161 return test::mock::stack_btm_inq::BTM_IsInquiryActive();
162 }
163
BTM_ReadRemoteDeviceName(const RawAddress & remote_bda,tBTM_NAME_CMPL_CB * p_cb,tBT_TRANSPORT transport)164 tBTM_STATUS BTM_ReadRemoteDeviceName(const RawAddress& remote_bda,
165 tBTM_NAME_CMPL_CB* p_cb,
166 tBT_TRANSPORT transport) {
167 inc_func_call_count(__func__);
168 return test::mock::stack_btm_inq::BTM_ReadRemoteDeviceName(remote_bda, p_cb,
169 transport);
170 }
BTM_RemoveEirService(uint32_t * p_eir_uuid,uint16_t uuid16)171 void BTM_RemoveEirService(uint32_t* p_eir_uuid, uint16_t uuid16) {
172 inc_func_call_count(__func__);
173 test::mock::stack_btm_inq::BTM_RemoveEirService(p_eir_uuid, uuid16);
174 }
BTM_SetConnectability(uint16_t page_mode)175 tBTM_STATUS BTM_SetConnectability(uint16_t page_mode) {
176 inc_func_call_count(__func__);
177 return test::mock::stack_btm_inq::BTM_SetConnectability(page_mode);
178 }
BTM_SetDiscoverability(uint16_t inq_mode)179 tBTM_STATUS BTM_SetDiscoverability(uint16_t inq_mode) {
180 inc_func_call_count(__func__);
181 return test::mock::stack_btm_inq::BTM_SetDiscoverability(inq_mode);
182 }
BTM_SetInquiryMode(uint8_t mode)183 tBTM_STATUS BTM_SetInquiryMode(uint8_t mode) {
184 inc_func_call_count(__func__);
185 return test::mock::stack_btm_inq::BTM_SetInquiryMode(mode);
186 }
BTM_StartInquiry(tBTM_INQ_RESULTS_CB * p_results_cb,tBTM_CMPL_CB * p_cmpl_cb)187 tBTM_STATUS BTM_StartInquiry(tBTM_INQ_RESULTS_CB* p_results_cb,
188 tBTM_CMPL_CB* p_cmpl_cb) {
189 inc_func_call_count(__func__);
190 return test::mock::stack_btm_inq::BTM_StartInquiry(p_results_cb, p_cmpl_cb);
191 }
BTM_WriteEIR(BT_HDR * p_buff)192 tBTM_STATUS BTM_WriteEIR(BT_HDR* p_buff) {
193 inc_func_call_count(__func__);
194 return test::mock::stack_btm_inq::BTM_WriteEIR(p_buff);
195 }
btm_clear_all_pending_le_entry(void)196 void btm_clear_all_pending_le_entry(void) {
197 inc_func_call_count(__func__);
198 test::mock::stack_btm_inq::btm_clear_all_pending_le_entry();
199 }
btm_clr_inq_db(const RawAddress * p_bda)200 void btm_clr_inq_db(const RawAddress* p_bda) {
201 inc_func_call_count(__func__);
202 test::mock::stack_btm_inq::btm_clr_inq_db(p_bda);
203 }
btm_clr_inq_result_flt(void)204 void btm_clr_inq_result_flt(void) {
205 inc_func_call_count(__func__);
206 test::mock::stack_btm_inq::btm_clr_inq_result_flt();
207 }
btm_inq_db_find(const RawAddress & p_bda)208 tINQ_DB_ENT* btm_inq_db_find(const RawAddress& p_bda) {
209 inc_func_call_count(__func__);
210 return test::mock::stack_btm_inq::btm_inq_db_find(p_bda);
211 }
btm_inq_db_new(const RawAddress & p_bda,bool is_ble)212 tINQ_DB_ENT* btm_inq_db_new(const RawAddress& p_bda, bool is_ble) {
213 inc_func_call_count(__func__);
214 return test::mock::stack_btm_inq::btm_inq_db_new(p_bda, is_ble);
215 }
btm_inq_db_reset(void)216 void btm_inq_db_reset(void) {
217 inc_func_call_count(__func__);
218 test::mock::stack_btm_inq::btm_inq_db_reset();
219 }
btm_inq_find_bdaddr(const RawAddress & p_bda)220 bool btm_inq_find_bdaddr(const RawAddress& p_bda) {
221 inc_func_call_count(__func__);
222 return test::mock::stack_btm_inq::btm_inq_find_bdaddr(p_bda);
223 }
btm_inq_remote_name_timer_timeout(void * data)224 void btm_inq_remote_name_timer_timeout(void* data) {
225 inc_func_call_count(__func__);
226 test::mock::stack_btm_inq::btm_inq_remote_name_timer_timeout(data);
227 }
btm_inq_rmt_name_failed_cancelled(void)228 void btm_inq_rmt_name_failed_cancelled(void) {
229 inc_func_call_count(__func__);
230 test::mock::stack_btm_inq::btm_inq_rmt_name_failed_cancelled();
231 }
btm_process_inq_complete(tHCI_STATUS status,uint8_t mode)232 void btm_process_inq_complete(tHCI_STATUS status, uint8_t mode) {
233 inc_func_call_count(__func__);
234 test::mock::stack_btm_inq::btm_process_inq_complete(status, mode);
235 }
btm_process_remote_name(const RawAddress * bda,const BD_NAME bdn,uint16_t evt_len,tHCI_STATUS hci_status)236 void btm_process_remote_name(const RawAddress* bda, const BD_NAME bdn,
237 uint16_t evt_len, tHCI_STATUS hci_status) {
238 inc_func_call_count(__func__);
239 test::mock::stack_btm_inq::btm_process_remote_name(bda, bdn, evt_len,
240 hci_status);
241 }
btm_set_eir_uuid(const uint8_t * p_eir,tBTM_INQ_RESULTS * p_results)242 void btm_set_eir_uuid(const uint8_t* p_eir, tBTM_INQ_RESULTS* p_results) {
243 inc_func_call_count(__func__);
244 test::mock::stack_btm_inq::btm_set_eir_uuid(p_eir, p_results);
245 }
btm_sort_inq_result(void)246 void btm_sort_inq_result(void) {
247 inc_func_call_count(__func__);
248 test::mock::stack_btm_inq::btm_sort_inq_result();
249 }
250 // Mocked functions complete
251 // END mockcify generation
252