• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #pragma once
17 
18 /*
19  * Generated mock file from original source file
20  *   Functions generated:18
21  *
22  *  mockcify.pl ver 0.6.0
23  */
24 
25 #include <cstdint>
26 #include <functional>
27 #include <map>
28 #include <string>
29 
30 // Original included files, if any
31 // NOTE: Since this is a mock file with mock definitions some number of
32 //       include files may not be required.  The include-what-you-use
33 //       still applies, but crafting proper inclusion is out of scope
34 //       for this effort.  This compilation unit may compile as-is, or
35 //       may need attention to prune from (or add to ) the inclusion set.
36 #include <cstdint>
37 #include <functional>
38 #include <map>
39 #include <string>
40 
41 #include "include/hardware/bluetooth.h"
42 #include "stack/include/bt_dev_class.h"
43 #include "test/common/mock_functions.h"
44 #include "test/mock/mock_btif_util.h"
45 
46 // Original usings
47 
48 // Mocked compile conditionals, if any
49 
50 namespace test {
51 namespace mock {
52 namespace btif_util {
53 
54 // Shared state between mocked functions and tests
55 // Name: ascii_2_hex
56 // Params: const char* p_ascii, int len, uint8_t* p_hex
57 // Return: int
58 struct ascii_2_hex {
59   static int return_value;
60   std::function<int(const char* p_ascii, int len, uint8_t* p_hex)> body{
61       [](const char* p_ascii, int len, uint8_t* p_hex) {
62         return return_value;
63       }};
operatorascii_2_hex64   int operator()(const char* p_ascii, int len, uint8_t* p_hex) {
65     return body(p_ascii, len, p_hex);
66   };
67 };
68 extern struct ascii_2_hex ascii_2_hex;
69 
70 // Name: devclass2uint
71 // Params: DEV_CLASS dev_class
72 // Return: uint32_t
73 struct devclass2uint {
74   static uint32_t return_value;
75   std::function<uint32_t(DEV_CLASS dev_class)> body{
76       [](DEV_CLASS dev_class) { return return_value; }};
operatordevclass2uint77   uint32_t operator()(DEV_CLASS dev_class) { return body(dev_class); };
78 };
79 extern struct devclass2uint devclass2uint;
80 
81 // Name: dump_adapter_scan_mode
82 // Params: bt_scan_mode_t mode
83 // Return: const char*
84 struct dump_adapter_scan_mode {
85   static const char* return_value;
86   std::function<const char*(bt_scan_mode_t mode)> body{
87       [](bt_scan_mode_t mode) { return return_value; }};
operatordump_adapter_scan_mode88   const char* operator()(bt_scan_mode_t mode) { return body(mode); };
89 };
90 extern struct dump_adapter_scan_mode dump_adapter_scan_mode;
91 
92 // Name: dump_av_audio_state
93 // Params: uint16_t event
94 // Return: const char*
95 struct dump_av_audio_state {
96   static const char* return_value;
97   std::function<const char*(uint16_t event)> body{
98       [](uint16_t event) { return return_value; }};
operatordump_av_audio_state99   const char* operator()(uint16_t event) { return body(event); };
100 };
101 extern struct dump_av_audio_state dump_av_audio_state;
102 
103 // Name: dump_av_conn_state
104 // Params: uint16_t event
105 // Return: const char*
106 struct dump_av_conn_state {
107   static const char* return_value;
108   std::function<const char*(uint16_t event)> body{
109       [](uint16_t event) { return return_value; }};
operatordump_av_conn_state110   const char* operator()(uint16_t event) { return body(event); };
111 };
112 extern struct dump_av_conn_state dump_av_conn_state;
113 
114 // Name: dump_bt_status
115 // Params: bt_status_t status
116 // Return: const char*
117 struct dump_bt_status {
118   static const char* return_value;
119   std::function<const char*(bt_status_t status)> body{
120       [](bt_status_t status) { return return_value; }};
operatordump_bt_status121   const char* operator()(bt_status_t status) { return body(status); };
122 };
123 extern struct dump_bt_status dump_bt_status;
124 
125 // Name: dump_dm_event
126 // Params: uint16_t event
127 // Return: const char*
128 struct dump_dm_event {
129   static const char* return_value;
130   std::function<const char*(uint16_t event)> body{
131       [](uint16_t event) { return return_value; }};
operatordump_dm_event132   const char* operator()(uint16_t event) { return body(event); };
133 };
134 extern struct dump_dm_event dump_dm_event;
135 
136 // Name: dump_dm_search_event
137 // Params: uint16_t event
138 // Return: const char*
139 struct dump_dm_search_event {
140   static const char* return_value;
141   std::function<const char*(uint16_t event)> body{
142       [](uint16_t event) { return return_value; }};
operatordump_dm_search_event143   const char* operator()(uint16_t event) { return body(event); };
144 };
145 extern struct dump_dm_search_event dump_dm_search_event;
146 
147 // Name: dump_hd_event
148 // Params: uint16_t event
149 // Return: const char*
150 struct dump_hd_event {
151   static const char* return_value;
152   std::function<const char*(uint16_t event)> body{
153       [](uint16_t event) { return return_value; }};
operatordump_hd_event154   const char* operator()(uint16_t event) { return body(event); };
155 };
156 extern struct dump_hd_event dump_hd_event;
157 
158 // Name: dump_hf_client_event
159 // Params: uint16_t event
160 // Return: const char*
161 struct dump_hf_client_event {
162   static const char* return_value;
163   std::function<const char*(uint16_t event)> body{
164       [](uint16_t event) { return return_value; }};
operatordump_hf_client_event165   const char* operator()(uint16_t event) { return body(event); };
166 };
167 extern struct dump_hf_client_event dump_hf_client_event;
168 
169 // Name: dump_hf_event
170 // Params: uint16_t event
171 // Return: const char*
172 struct dump_hf_event {
173   static const char* return_value;
174   std::function<const char*(uint16_t event)> body{
175       [](uint16_t event) { return return_value; }};
operatordump_hf_event176   const char* operator()(uint16_t event) { return body(event); };
177 };
178 extern struct dump_hf_event dump_hf_event;
179 
180 // Name: dump_hh_event
181 // Params: uint16_t event
182 // Return: const char*
183 struct dump_hh_event {
184   static const char* return_value;
185   std::function<const char*(uint16_t event)> body{
186       [](uint16_t event) { return return_value; }};
operatordump_hh_event187   const char* operator()(uint16_t event) { return body(event); };
188 };
189 extern struct dump_hh_event dump_hh_event;
190 
191 // Name: dump_property_type
192 // Params: bt_property_type_t type
193 // Return: const char*
194 struct dump_property_type {
195   static const char* return_value;
196   std::function<const char*(bt_property_type_t type)> body{
197       [](bt_property_type_t type) { return return_value; }};
operatordump_property_type198   const char* operator()(bt_property_type_t type) { return body(type); };
199 };
200 extern struct dump_property_type dump_property_type;
201 
202 // Name: dump_rc_event
203 // Params: uint8_t event
204 // Return: const char*
205 struct dump_rc_event {
206   static const char* return_value;
207   std::function<const char*(uint8_t event)> body{
208       [](uint8_t event) { return return_value; }};
operatordump_rc_event209   const char* operator()(uint8_t event) { return body(event); };
210 };
211 extern struct dump_rc_event dump_rc_event;
212 
213 // Name: dump_rc_notification_event_id
214 // Params: uint8_t event_id
215 // Return: const char*
216 struct dump_rc_notification_event_id {
217   static const char* return_value;
218   std::function<const char*(uint8_t event_id)> body{
219       [](uint8_t event_id) { return return_value; }};
operatordump_rc_notification_event_id220   const char* operator()(uint8_t event_id) { return body(event_id); };
221 };
222 extern struct dump_rc_notification_event_id dump_rc_notification_event_id;
223 
224 // Name: dump_rc_pdu
225 // Params: uint8_t pdu
226 // Return: const char*
227 struct dump_rc_pdu {
228   static const char* return_value;
229   std::function<const char*(uint8_t pdu)> body{
230       [](uint8_t pdu) { return return_value; }};
operatordump_rc_pdu231   const char* operator()(uint8_t pdu) { return body(pdu); };
232 };
233 extern struct dump_rc_pdu dump_rc_pdu;
234 
235 // Name: dump_thread_evt
236 // Params: bt_cb_thread_evt evt
237 // Return: const char*
238 struct dump_thread_evt {
239   static const char* return_value;
240   std::function<const char*(bt_cb_thread_evt evt)> body{
241       [](bt_cb_thread_evt evt) { return return_value; }};
operatordump_thread_evt242   const char* operator()(bt_cb_thread_evt evt) { return body(evt); };
243 };
244 extern struct dump_thread_evt dump_thread_evt;
245 
246 // Name: uint2devclass
247 // Params: uint32_t cod, DEV_CLASS dev_class
248 // Return: void
249 struct uint2devclass {
250   std::function<void(uint32_t cod, DEV_CLASS dev_class)> body{
251       [](uint32_t cod, DEV_CLASS dev_class) {}};
operatoruint2devclass252   void operator()(uint32_t cod, DEV_CLASS dev_class) { body(cod, dev_class); };
253 };
254 extern struct uint2devclass uint2devclass;
255 
256 }  // namespace btif_util
257 }  // namespace mock
258 }  // namespace test
259 
260 // END mockcify generation
261