1 /*
2  * Copyright 2021 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 /*
18  * Generated mock file from original source file
19  *   Functions generated:10
20  *
21  *  mockcify.pl ver 0.2
22  */
23 
24 #include <cstdint>
25 #include <functional>
26 #include <map>
27 #include <string>
28 
29 extern std::map<std::string, int> mock_function_count_map;
30 
31 // Mock include file to share data between tests and mock
32 #include "test/mock/mock_main_shim_link_policy.h"
33 
34 // Mocked compile conditionals, if any
35 #ifndef UNUSED_ATTR
36 #define UNUSED_ATTR
37 #endif
38 
39 // Mocked internal structures, if any
40 
41 namespace test {
42 namespace mock {
43 namespace main_shim_link_policy {
44 
45 // Function state capture and return values, if needed
46 struct set_active_mode set_active_mode;
47 struct set_hold_mode set_hold_mode;
48 struct set_sniff_mode set_sniff_mode;
49 struct controller_supports_link_policy_mode
50     controller_supports_link_policy_mode;
51 struct RegisterLinkPolicyClient RegisterLinkPolicyClient;
52 struct UnregisterLinkPolicyClient UnregisterLinkPolicyClient;
53 struct BTM_SetPowerMode BTM_SetPowerMode;
54 struct btm_pm_on_mode_change btm_pm_on_mode_change;
55 struct BTM_SetSsrParams BTM_SetSsrParams;
56 struct btm_pm_on_sniff_subrating btm_pm_on_sniff_subrating;
57 
58 }  // namespace main_shim_link_policy
59 }  // namespace mock
60 }  // namespace test
61 
62 // Mocked functions, if any
set_active_mode(tACL_CONN & p_acl)63 tBTM_STATUS set_active_mode(tACL_CONN& p_acl) {
64   mock_function_count_map[__func__]++;
65   return test::mock::main_shim_link_policy::set_active_mode(p_acl);
66 }
set_hold_mode(tACL_CONN & p_acl,uint16_t max,uint16_t min)67 tBTM_STATUS set_hold_mode(tACL_CONN& p_acl, uint16_t max, uint16_t min) {
68   mock_function_count_map[__func__]++;
69   return test::mock::main_shim_link_policy::set_hold_mode(p_acl, max, min);
70 }
set_sniff_mode(tACL_CONN & p_acl,uint16_t max_interval,uint16_t min_interval,uint16_t attempt,uint16_t timeout)71 tBTM_STATUS set_sniff_mode(tACL_CONN& p_acl, uint16_t max_interval,
72                            uint16_t min_interval, uint16_t attempt,
73                            uint16_t timeout) {
74   mock_function_count_map[__func__]++;
75   return test::mock::main_shim_link_policy::set_sniff_mode(
76       p_acl, max_interval, min_interval, attempt, timeout);
77 }
controller_supports_link_policy_mode(const tBTM_PM_MODE & mode,bool interop_check)78 bool controller_supports_link_policy_mode(const tBTM_PM_MODE& mode,
79                                           bool interop_check) {
80   mock_function_count_map[__func__]++;
81   return test::mock::main_shim_link_policy::
82       controller_supports_link_policy_mode(mode, interop_check);
83 }
RegisterLinkPolicyClient(tBTM_PM_STATUS_CBACK * p_cb)84 bool bluetooth::shim::RegisterLinkPolicyClient(tBTM_PM_STATUS_CBACK* p_cb) {
85   mock_function_count_map[__func__]++;
86   return test::mock::main_shim_link_policy::RegisterLinkPolicyClient(p_cb);
87 }
UnregisterLinkPolicyClient(tBTM_PM_STATUS_CBACK * p_cb)88 bool bluetooth::shim::UnregisterLinkPolicyClient(tBTM_PM_STATUS_CBACK* p_cb) {
89   mock_function_count_map[__func__]++;
90   return test::mock::main_shim_link_policy::UnregisterLinkPolicyClient(p_cb);
91 }
BTM_SetPowerMode(uint16_t handle,const tBTM_PM_PWR_MD & new_mode)92 tBTM_STATUS bluetooth::shim::BTM_SetPowerMode(uint16_t handle,
93                                               const tBTM_PM_PWR_MD& new_mode) {
94   mock_function_count_map[__func__]++;
95   return test::mock::main_shim_link_policy::BTM_SetPowerMode(handle, new_mode);
96 }
btm_pm_on_mode_change(tHCI_STATUS status,uint16_t handle,tHCI_MODE hci_mode,uint16_t interval)97 void bluetooth::shim::btm_pm_on_mode_change(tHCI_STATUS status, uint16_t handle,
98                                             tHCI_MODE hci_mode,
99                                             uint16_t interval) {
100   mock_function_count_map[__func__]++;
101   test::mock::main_shim_link_policy::btm_pm_on_mode_change(status, handle,
102                                                            hci_mode, interval);
103 }
BTM_SetSsrParams(uint16_t handle,uint16_t max_lat,uint16_t min_rmt_to,uint16_t min_loc_to)104 tBTM_STATUS bluetooth::shim::BTM_SetSsrParams(uint16_t handle, uint16_t max_lat,
105                                               uint16_t min_rmt_to,
106                                               uint16_t min_loc_to) {
107   mock_function_count_map[__func__]++;
108   return test::mock::main_shim_link_policy::BTM_SetSsrParams(
109       handle, max_lat, min_rmt_to, min_loc_to);
110 }
btm_pm_on_sniff_subrating(tHCI_STATUS status,uint16_t handle,uint16_t maximum_transmit_latency,UNUSED_ATTR uint16_t maximum_receive_latency,uint16_t minimum_remote_timeout,uint16_t minimum_local_timeout)111 void bluetooth::shim::btm_pm_on_sniff_subrating(
112     tHCI_STATUS status, uint16_t handle, uint16_t maximum_transmit_latency,
113     UNUSED_ATTR uint16_t maximum_receive_latency,
114     uint16_t minimum_remote_timeout, uint16_t minimum_local_timeout) {
115   mock_function_count_map[__func__]++;
116   test::mock::main_shim_link_policy::btm_pm_on_sniff_subrating(
117       status, handle, maximum_transmit_latency, maximum_receive_latency,
118       minimum_remote_timeout, minimum_local_timeout);
119 }
120 
121 // END mockcify generation
122