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 "stack/btm/internal/btm_api.h"
28 #include "stack/include/btm_inq.h"
29 #include "stack/include/btm_status.h"
30 #include "stack/include/inq_hci_link_interface.h"
31 #include "test/common/mock_functions.h"
32
33 // Original usings
34
35 // Mocked internal structures, if any
36
37 namespace test {
38 namespace mock {
39 namespace stack_btm_inq {
40
41 // Function state capture and return values, if needed
42 struct BTM_CancelInquiry BTM_CancelInquiry;
43 struct BTM_EnableInterlacedInquiryScan BTM_EnableInterlacedInquiryScan;
44 struct BTM_EnableInterlacedPageScan BTM_EnableInterlacedPageScan;
45 struct BTM_HasEirService BTM_HasEirService;
46 struct BTM_IsInquiryActive BTM_IsInquiryActive;
47 struct BTM_SetConnectability BTM_SetConnectability;
48 struct BTM_SetDiscoverability BTM_SetDiscoverability;
49 struct BTM_SetInquiryMode BTM_SetInquiryMode;
50 struct BTM_StartInquiry BTM_StartInquiry;
51 struct btm_clr_inq_result_flt btm_clr_inq_result_flt;
52 struct btm_inq_db_find btm_inq_db_find;
53 struct btm_inq_db_new btm_inq_db_new;
54 struct btm_inq_db_reset btm_inq_db_reset;
55 struct btm_inq_find_bdaddr btm_inq_find_bdaddr;
56 struct btm_process_inq_complete btm_process_inq_complete;
57
58 } // namespace stack_btm_inq
59 } // namespace mock
60 } // namespace test
61
62 // Mocked function return values, if any
63 namespace test {
64 namespace mock {
65 namespace stack_btm_inq {
66
67 bool BTM_HasEirService::return_value = false;
68 uint16_t BTM_IsInquiryActive::return_value = 0;
69 tBTM_STATUS BTM_SetConnectability::return_value = tBTM_STATUS::BTM_SUCCESS;
70 tBTM_STATUS BTM_SetDiscoverability::return_value = tBTM_STATUS::BTM_SUCCESS;
71 tBTM_STATUS BTM_SetInquiryMode::return_value = tBTM_STATUS::BTM_SUCCESS;
72 tBTM_STATUS BTM_StartInquiry::return_value = tBTM_STATUS::BTM_SUCCESS;
73 tINQ_DB_ENT* btm_inq_db_find::return_value = nullptr;
74 tINQ_DB_ENT* btm_inq_db_new::return_value = nullptr;
75 bool btm_inq_find_bdaddr::return_value = false;
76
77 } // namespace stack_btm_inq
78 } // namespace mock
79 } // namespace test
80
81 // Mocked functions, if any
BTM_CancelInquiry(void)82 void BTM_CancelInquiry(void) {
83 inc_func_call_count(__func__);
84 test::mock::stack_btm_inq::BTM_CancelInquiry();
85 }
BTM_EnableInterlacedInquiryScan()86 void BTM_EnableInterlacedInquiryScan() {
87 inc_func_call_count(__func__);
88 test::mock::stack_btm_inq::BTM_EnableInterlacedInquiryScan();
89 }
BTM_EnableInterlacedPageScan()90 void BTM_EnableInterlacedPageScan() {
91 inc_func_call_count(__func__);
92 test::mock::stack_btm_inq::BTM_EnableInterlacedPageScan();
93 }
BTM_HasEirService(const uint32_t * p_eir_uuid,uint16_t uuid16)94 bool BTM_HasEirService(const uint32_t* p_eir_uuid, uint16_t uuid16) {
95 inc_func_call_count(__func__);
96 return test::mock::stack_btm_inq::BTM_HasEirService(p_eir_uuid, uuid16);
97 }
BTM_IsInquiryActive(void)98 uint16_t BTM_IsInquiryActive(void) {
99 inc_func_call_count(__func__);
100 return test::mock::stack_btm_inq::BTM_IsInquiryActive();
101 }
BTM_SetConnectability(uint16_t page_mode)102 tBTM_STATUS BTM_SetConnectability(uint16_t page_mode) {
103 inc_func_call_count(__func__);
104 return test::mock::stack_btm_inq::BTM_SetConnectability(page_mode);
105 }
BTM_SetDiscoverability(uint16_t inq_mode)106 tBTM_STATUS BTM_SetDiscoverability(uint16_t inq_mode) {
107 inc_func_call_count(__func__);
108 return test::mock::stack_btm_inq::BTM_SetDiscoverability(inq_mode);
109 }
BTM_SetInquiryMode(uint8_t mode)110 tBTM_STATUS BTM_SetInquiryMode(uint8_t mode) {
111 inc_func_call_count(__func__);
112 return test::mock::stack_btm_inq::BTM_SetInquiryMode(mode);
113 }
BTM_StartInquiry(tBTM_INQ_RESULTS_CB * p_results_cb,tBTM_CMPL_CB * p_cmpl_cb)114 tBTM_STATUS BTM_StartInquiry(tBTM_INQ_RESULTS_CB* p_results_cb, tBTM_CMPL_CB* p_cmpl_cb) {
115 inc_func_call_count(__func__);
116 return test::mock::stack_btm_inq::BTM_StartInquiry(p_results_cb, p_cmpl_cb);
117 }
btm_clr_inq_result_flt(void)118 void btm_clr_inq_result_flt(void) {
119 inc_func_call_count(__func__);
120 test::mock::stack_btm_inq::btm_clr_inq_result_flt();
121 }
btm_inq_db_find(const RawAddress & p_bda)122 tINQ_DB_ENT* btm_inq_db_find(const RawAddress& p_bda) {
123 inc_func_call_count(__func__);
124 return test::mock::stack_btm_inq::btm_inq_db_find(p_bda);
125 }
btm_inq_db_new(const RawAddress & p_bda,bool is_ble)126 tINQ_DB_ENT* btm_inq_db_new(const RawAddress& p_bda, bool is_ble) {
127 inc_func_call_count(__func__);
128 return test::mock::stack_btm_inq::btm_inq_db_new(p_bda, is_ble);
129 }
btm_inq_db_reset(void)130 void btm_inq_db_reset(void) {
131 inc_func_call_count(__func__);
132 test::mock::stack_btm_inq::btm_inq_db_reset();
133 }
btm_inq_find_bdaddr(const RawAddress & p_bda)134 bool btm_inq_find_bdaddr(const RawAddress& p_bda) {
135 inc_func_call_count(__func__);
136 return test::mock::stack_btm_inq::btm_inq_find_bdaddr(p_bda);
137 }
btm_process_inq_complete(tHCI_STATUS status,uint8_t mode)138 void btm_process_inq_complete(tHCI_STATUS status, uint8_t mode) {
139 inc_func_call_count(__func__);
140 test::mock::stack_btm_inq::btm_process_inq_complete(status, mode);
141 }
142 // Mocked functions complete
143 // END mockcify generation
144