• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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:11
20  *
21  *  mockcify.pl ver 0.2
22  */
23 
24 #include <cstdint>
25 #include <functional>
26 #include <map>
27 #include <string>
28 
29 // Original included files, if any
30 // NOTE: Since this is a mock file with mock definitions some number of
31 //       include files may not be required.  The include-what-you-use
32 //       still applies, but crafting proper inclusion is out of scope
33 //       for this effort.  This compilation unit may compile as-is, or
34 //       may need attention to prune the inclusion set.
35 #include <base/functional/bind.h>
36 
37 #include <cstdint>
38 #include <unordered_map>
39 
40 #include "device/include/controller.h"
41 #include "main/shim/acl_api.h"
42 #include "main/shim/shim.h"
43 #include "stack/btm/btm_dev.h"
44 #include "stack/btm/btm_int_types.h"
45 #include "stack/btm/security_device_record.h"
46 #include "test/common/mock_functions.h"
47 #include "types/raw_address.h"
48 
49 // Mocked compile conditionals, if any
50 #ifndef UNUSED_ATTR
51 #define UNUSED_ATTR
52 #endif
53 
54 namespace test {
55 namespace mock {
56 namespace stack_btm_ble_bgconn {
57 
58 // Shared state between mocked functions and tests
59 // Name: convert_to_address_with_type
60 // Params:  const RawAddress& bd_addr, const tBTM_SEC_DEV_REC* p_dev_rec
61 // Returns: const tBLE_BD_ADDR
62 struct convert_to_address_with_type {
63   tBLE_BD_ADDR ble_bd_addr;
64   std::function<const tBLE_BD_ADDR(const RawAddress& bd_addr,
65                                    const tBTM_SEC_DEV_REC* p_dev_rec)>
66       body{[this](const RawAddress& bd_addr,
67                   const tBTM_SEC_DEV_REC* p_dev_rec) { return ble_bd_addr; }};
operatorconvert_to_address_with_type68   const tBLE_BD_ADDR operator()(const RawAddress& bd_addr,
69                                 const tBTM_SEC_DEV_REC* p_dev_rec) {
70     return body(bd_addr, p_dev_rec);
71   };
72 };
73 extern struct convert_to_address_with_type convert_to_address_with_type;
74 // Name: btm_update_scanner_filter_policy
75 // Params: tBTM_BLE_SFP scan_policy
76 // Returns: void
77 struct btm_update_scanner_filter_policy {
78   std::function<void(tBTM_BLE_SFP scan_policy)> body{
79       [](tBTM_BLE_SFP scan_policy) {}};
operatorbtm_update_scanner_filter_policy80   void operator()(tBTM_BLE_SFP scan_policy) { body(scan_policy); };
81 };
82 extern struct btm_update_scanner_filter_policy btm_update_scanner_filter_policy;
83 // Name: btm_ble_suspend_bg_conn
84 // Params: void
85 // Returns: bool
86 struct btm_ble_suspend_bg_conn {
87   std::function<bool(void)> body{[](void) { return false; }};
operatorbtm_ble_suspend_bg_conn88   bool operator()(void) { return body(); };
89 };
90 extern struct btm_ble_suspend_bg_conn btm_ble_suspend_bg_conn;
91 // Name: btm_ble_resume_bg_conn
92 // Params: void
93 // Returns: bool
94 struct btm_ble_resume_bg_conn {
95   std::function<bool(void)> body{[](void) { return false; }};
operatorbtm_ble_resume_bg_conn96   bool operator()(void) { return body(); };
97 };
98 extern struct btm_ble_resume_bg_conn btm_ble_resume_bg_conn;
99 // Name: BTM_BackgroundConnectAddressKnown
100 // Params: const RawAddress& address
101 // Returns: bool
102 struct BTM_BackgroundConnectAddressKnown {
103   std::function<bool(const RawAddress& address)> body{
104       [](const RawAddress& address) { return false; }};
operatorBTM_BackgroundConnectAddressKnown105   bool operator()(const RawAddress& address) { return body(address); };
106 };
107 extern struct BTM_BackgroundConnectAddressKnown
108     BTM_BackgroundConnectAddressKnown;
109 // Name: BTM_SetLeConnectionModeToFast
110 // Params:
111 // Returns: bool
112 struct BTM_SetLeConnectionModeToFast {
113   std::function<bool()> body{[]() { return false; }};
operatorBTM_SetLeConnectionModeToFast114   bool operator()() { return body(); };
115 };
116 extern struct BTM_SetLeConnectionModeToFast BTM_SetLeConnectionModeToFast;
117 // Name: BTM_SetLeConnectionModeToSlow
118 // Params:
119 // Returns: void
120 struct BTM_SetLeConnectionModeToSlow {
121   std::function<void()> body{[]() {}};
operatorBTM_SetLeConnectionModeToSlow122   void operator()() { body(); };
123 };
124 extern struct BTM_SetLeConnectionModeToSlow BTM_SetLeConnectionModeToSlow;
125 // Name: BTM_AcceptlistAdd
126 // Params: const RawAddress& address
127 // Returns: bool
128 struct BTM_AcceptlistAdd {
129   std::function<bool(const RawAddress& address)> body{
130       [](const RawAddress& address) { return false; }};
operatorBTM_AcceptlistAdd131   bool operator()(const RawAddress& address) { return body(address); };
132 };
133 extern struct BTM_AcceptlistAdd BTM_AcceptlistAdd;
134 // Name: BTM_AcceptlistAddDirect
135 // Params: const RawAddress& address, bool is_direct
136 // Returns: bool
137 struct BTM_AcceptlistAddDirect {
138   std::function<bool(const RawAddress& address, bool is_direct)> body{
139       [](const RawAddress& address, bool is_direct) { return false; }};
operatorBTM_AcceptlistAddDirect140   bool operator()(const RawAddress& address, bool is_direct) {
141     return body(address, is_direct);
142   };
143 };
144 extern struct BTM_AcceptlistAddDirect BTM_AcceptlistAddDirect;
145 // Name: BTM_AcceptlistRemove
146 // Params: const RawAddress& address
147 // Returns: void
148 struct BTM_AcceptlistRemove {
149   std::function<void(const RawAddress& address)> body{
150       [](const RawAddress& address) {}};
operatorBTM_AcceptlistRemove151   void operator()(const RawAddress& address) { body(address); };
152 };
153 extern struct BTM_AcceptlistRemove BTM_AcceptlistRemove;
154 // Name: BTM_AcceptlistClear
155 // Params:
156 // Returns: void
157 struct BTM_AcceptlistClear {
158   std::function<void()> body{[]() {}};
operatorBTM_AcceptlistClear159   void operator()() { body(); };
160 };
161 extern struct BTM_AcceptlistClear BTM_AcceptlistClear;
162 
163 }  // namespace stack_btm_ble_bgconn
164 }  // namespace mock
165 }  // namespace test
166 
167 // END mockcify generation
168