• 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:18
20  *
21  *  mockcify.pl ver 0.2
22  */
23 
24 #include <map>
25 #include <string>
26 
27 extern std::map<std::string, int> mock_function_count_map;
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 
36 #include "btif/include/btif_config.h"
37 
38 // Mocked compile conditionals, if any
39 #ifndef UNUSED_ATTR
40 #define UNUSED_ATTR
41 #endif
42 
43 namespace test {
44 namespace mock {
45 namespace btif_config {
46 
47 // Shared state between mocked functions and tests
48 // Name: btif_get_device_type
49 // Params: const RawAddress& bda, int* p_device_type
50 // Returns: bool
51 struct btif_get_device_type {
52   std::function<bool(const RawAddress& bda, int* p_device_type)> body{
53       [](const RawAddress& bda, int* p_device_type) { return false; }};
operatorbtif_get_device_type54   bool operator()(const RawAddress& bda, int* p_device_type) {
55     return body(bda, p_device_type);
56   };
57 };
58 extern struct btif_get_device_type btif_get_device_type;
59 // Name: btif_get_address_type
60 // Params: const RawAddress& bda, tBLE_ADDR_TYPE* p_addr_type
61 // Returns: bool
62 struct btif_get_address_type {
63   std::function<bool(const RawAddress& bda, tBLE_ADDR_TYPE* p_addr_type)> body{
64       [](const RawAddress& bda, tBLE_ADDR_TYPE* p_addr_type) { return false; }};
operatorbtif_get_address_type65   bool operator()(const RawAddress& bda, tBLE_ADDR_TYPE* p_addr_type) {
66     return body(bda, p_addr_type);
67   };
68 };
69 extern struct btif_get_address_type btif_get_address_type;
70 // Name: btif_config_exist
71 // Params: const std::string& section, const std::string& key
72 // Returns: bool
73 struct btif_config_exist {
74   std::function<bool(const std::string& section, const std::string& key)> body{
75       [](const std::string& section, const std::string& key) { return false; }};
operatorbtif_config_exist76   bool operator()(const std::string& section, const std::string& key) {
77     return body(section, key);
78   };
79 };
80 extern struct btif_config_exist btif_config_exist;
81 // Name: btif_config_get_int
82 // Params: const std::string& section, const std::string& key, int* value
83 // Returns: bool
84 struct btif_config_get_int {
85   std::function<bool(const std::string& section, const std::string& key,
86                      int* value)>
87       body{[](const std::string& section, const std::string& key, int* value) {
88         return false;
89       }};
operatorbtif_config_get_int90   bool operator()(const std::string& section, const std::string& key,
91                   int* value) {
92     return body(section, key, value);
93   };
94 };
95 extern struct btif_config_get_int btif_config_get_int;
96 // Name: btif_config_set_int
97 // Params: const std::string& section, const std::string& key, int value
98 // Returns: bool
99 struct btif_config_set_int {
100   std::function<bool(const std::string& section, const std::string& key,
101                      int value)>
102       body{[](const std::string& section, const std::string& key, int value) {
103         return false;
104       }};
operatorbtif_config_set_int105   bool operator()(const std::string& section, const std::string& key,
106                   int value) {
107     return body(section, key, value);
108   };
109 };
110 extern struct btif_config_set_int btif_config_set_int;
111 // Name: btif_config_get_uint64
112 // Params: const std::string& section, const std::string& key, uint64_t* value
113 // Returns: bool
114 struct btif_config_get_uint64 {
115   std::function<bool(const std::string& section, const std::string& key,
116                      uint64_t* value)>
117       body{[](const std::string& section, const std::string& key,
118               uint64_t* value) { return false; }};
operatorbtif_config_get_uint64119   bool operator()(const std::string& section, const std::string& key,
120                   uint64_t* value) {
121     return body(section, key, value);
122   };
123 };
124 extern struct btif_config_get_uint64 btif_config_get_uint64;
125 // Name: btif_config_set_uint64
126 // Params: const std::string& section, const std::string& key, uint64_t value
127 // Returns: bool
128 struct btif_config_set_uint64 {
129   std::function<bool(const std::string& section, const std::string& key,
130                      uint64_t value)>
131       body{[](const std::string& section, const std::string& key,
132               uint64_t value) { return false; }};
operatorbtif_config_set_uint64133   bool operator()(const std::string& section, const std::string& key,
134                   uint64_t value) {
135     return body(section, key, value);
136   };
137 };
138 extern struct btif_config_set_uint64 btif_config_set_uint64;
139 // Name: btif_config_get_str
140 // Params: const std::string& section, const std::string& key, char* value, int*
141 // size_bytes Returns: bool
142 struct btif_config_get_str {
143   std::function<bool(const std::string& section, const std::string& key,
144                      char* value, int* size_bytes)>
145       body{[](const std::string& section, const std::string& key, char* value,
146               int* size_bytes) { return false; }};
operatorbtif_config_get_str147   bool operator()(const std::string& section, const std::string& key,
148                   char* value, int* size_bytes) {
149     return body(section, key, value, size_bytes);
150   };
151 };
152 extern struct btif_config_get_str btif_config_get_str;
153 // Name: btif_config_set_str
154 // Params: const std::string& section, const std::string& key, const
155 // std::string& value Returns: bool
156 struct btif_config_set_str {
157   std::function<bool(const std::string& section, const std::string& key,
158                      const std::string& value)>
159       body{[](const std::string& section, const std::string& key,
160               const std::string& value) { return false; }};
operatorbtif_config_set_str161   bool operator()(const std::string& section, const std::string& key,
162                   const std::string& value) {
163     return body(section, key, value);
164   };
165 };
166 extern struct btif_config_set_str btif_config_set_str;
167 // Name: btif_config_get_bin
168 // Params: const std::string& section, const std::string& key, uint8_t* value,
169 // size_t* length Returns: bool
170 struct btif_config_get_bin {
171   std::function<bool(const std::string& section, const std::string& key,
172                      uint8_t* value, size_t* length)>
173       body{[](const std::string& section, const std::string& key,
174               uint8_t* value, size_t* length) { return false; }};
operatorbtif_config_get_bin175   bool operator()(const std::string& section, const std::string& key,
176                   uint8_t* value, size_t* length) {
177     return body(section, key, value, length);
178   };
179 };
180 extern struct btif_config_get_bin btif_config_get_bin;
181 // Name: btif_config_get_bin_length
182 // Params: const std::string& section, const std::string& key
183 // Returns: size_t
184 struct btif_config_get_bin_length {
185   std::function<size_t(const std::string& section, const std::string& key)>
186       body{
187           [](const std::string& section, const std::string& key) { return 0; }};
operatorbtif_config_get_bin_length188   size_t operator()(const std::string& section, const std::string& key) {
189     return body(section, key);
190   };
191 };
192 extern struct btif_config_get_bin_length btif_config_get_bin_length;
193 // Name: btif_config_set_bin
194 // Params: const std::string& section, const std::string& key, const uint8_t*
195 // value, size_t length Returns: bool
196 struct btif_config_set_bin {
197   std::function<bool(const std::string& section, const std::string& key,
198                      const uint8_t* value, size_t length)>
199       body{[](const std::string& section, const std::string& key,
200               const uint8_t* value, size_t length) { return false; }};
operatorbtif_config_set_bin201   bool operator()(const std::string& section, const std::string& key,
202                   const uint8_t* value, size_t length) {
203     return body(section, key, value, length);
204   };
205 };
206 extern struct btif_config_set_bin btif_config_set_bin;
207 // Name: btif_config_get_paired_devices
208 // Params:
209 // Returns: std::vector<RawAddress>
210 struct btif_config_get_paired_devices {
211   std::vector<RawAddress> raw_addresses;
212   std::function<std::vector<RawAddress>()> body{
213       [this]() { return raw_addresses; }};
operatorbtif_config_get_paired_devices214   std::vector<RawAddress> operator()() { return body(); };
215 };
216 extern struct btif_config_get_paired_devices btif_config_get_paired_devices;
217 // Name: btif_config_remove
218 // Params: const std::string& section, const std::string& key
219 // Returns: bool
220 struct btif_config_remove {
221   std::function<bool(const std::string& section, const std::string& key)> body{
222       [](const std::string& section, const std::string& key) { return false; }};
operatorbtif_config_remove223   bool operator()(const std::string& section, const std::string& key) {
224     return body(section, key);
225   };
226 };
227 extern struct btif_config_remove btif_config_remove;
228 // Name: btif_config_save
229 // Params: void
230 // Returns: void
231 struct btif_config_save {
232   std::function<void(void)> body{[](void) {}};
operatorbtif_config_save233   void operator()(void) { body(); };
234 };
235 extern struct btif_config_save btif_config_save;
236 // Name: btif_config_flush
237 // Params: void
238 // Returns: void
239 struct btif_config_flush {
240   std::function<void(void)> body{[](void) {}};
operatorbtif_config_flush241   void operator()(void) { body(); };
242 };
243 extern struct btif_config_flush btif_config_flush;
244 // Name: btif_config_clear
245 // Params: void
246 // Returns: bool
247 struct btif_config_clear {
248   std::function<bool(void)> body{[](void) { return false; }};
operatorbtif_config_clear249   bool operator()(void) { return body(); };
250 };
251 extern struct btif_config_clear btif_config_clear;
252 // Name: btif_debug_config_dump
253 // Params: int fd
254 // Returns: void
255 struct btif_debug_config_dump {
256   std::function<void(int fd)> body{[](int fd) {}};
operatorbtif_debug_config_dump257   void operator()(int fd) { body(fd); };
258 };
259 extern struct btif_debug_config_dump btif_debug_config_dump;
260 
261 }  // namespace btif_config
262 }  // namespace mock
263 }  // namespace test
264 
265 // END mockcify generation
266