• 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 #include "test/common/mock_functions.h"
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 #include "types/raw_address.h"
38 
39 // Mocked compile conditionals, if any
40 
41 namespace test {
42 namespace mock {
43 namespace btif_config {
44 
45 // Shared state between mocked functions and tests
46 // Name: btif_config_exist
47 // Params: const std::string& section, const std::string& key
48 // Returns: bool
49 struct btif_config_exist {
50   std::function<bool(const std::string& section, const std::string& key)> body{
51       [](const std::string& section, const std::string& key) { return false; }};
operatorbtif_config_exist52   bool operator()(const std::string& section, const std::string& key) {
53     return body(section, key);
54   };
55 };
56 extern struct btif_config_exist btif_config_exist;
57 // Name: btif_config_get_int
58 // Params: const std::string& section, const std::string& key, int* value
59 // Returns: bool
60 struct btif_config_get_int {
61   std::function<bool(const std::string& section, const std::string& key,
62                      int* value)>
63       body{[](const std::string& section, const std::string& key, int* value) {
64         return false;
65       }};
operatorbtif_config_get_int66   bool operator()(const std::string& section, const std::string& key,
67                   int* value) {
68     return body(section, key, value);
69   };
70 };
71 extern struct btif_config_get_int btif_config_get_int;
72 // Name: btif_config_set_int
73 // Params: const std::string& section, const std::string& key, int value
74 // Returns: bool
75 struct btif_config_set_int {
76   std::function<bool(const std::string& section, const std::string& key,
77                      int value)>
78       body{[](const std::string& section, const std::string& key, int value) {
79         return false;
80       }};
operatorbtif_config_set_int81   bool operator()(const std::string& section, const std::string& key,
82                   int value) {
83     return body(section, key, value);
84   };
85 };
86 extern struct btif_config_set_int btif_config_set_int;
87 // Name: btif_config_get_uint64
88 // Params: const std::string& section, const std::string& key, uint64_t* value
89 // Returns: bool
90 struct btif_config_get_uint64 {
91   std::function<bool(const std::string& section, const std::string& key,
92                      uint64_t* value)>
93       body{[](const std::string& section, const std::string& key,
94               uint64_t* value) { return false; }};
operatorbtif_config_get_uint6495   bool operator()(const std::string& section, const std::string& key,
96                   uint64_t* value) {
97     return body(section, key, value);
98   };
99 };
100 extern struct btif_config_get_uint64 btif_config_get_uint64;
101 // Name: btif_config_set_uint64
102 // Params: const std::string& section, const std::string& key, uint64_t value
103 // Returns: bool
104 struct btif_config_set_uint64 {
105   std::function<bool(const std::string& section, const std::string& key,
106                      uint64_t value)>
107       body{[](const std::string& section, const std::string& key,
108               uint64_t value) { return false; }};
operatorbtif_config_set_uint64109   bool operator()(const std::string& section, const std::string& key,
110                   uint64_t value) {
111     return body(section, key, value);
112   };
113 };
114 extern struct btif_config_set_uint64 btif_config_set_uint64;
115 // Name: btif_config_get_str
116 // Params: const std::string& section, const std::string& key, char* value, int*
117 // size_bytes Returns: bool
118 struct btif_config_get_str {
119   std::function<bool(const std::string& section, const std::string& key,
120                      char* value, int* size_bytes)>
121       body{[](const std::string& section, const std::string& key, char* value,
122               int* size_bytes) { return false; }};
operatorbtif_config_get_str123   bool operator()(const std::string& section, const std::string& key,
124                   char* value, int* size_bytes) {
125     return body(section, key, value, size_bytes);
126   };
127 };
128 extern struct btif_config_get_str btif_config_get_str;
129 // Name: btif_config_set_str
130 // Params: const std::string& section, const std::string& key, const
131 // std::string& value Returns: bool
132 struct btif_config_set_str {
133   std::function<bool(const std::string& section, const std::string& key,
134                      const std::string& value)>
135       body{[](const std::string& section, const std::string& key,
136               const std::string& value) { return false; }};
operatorbtif_config_set_str137   bool operator()(const std::string& section, const std::string& key,
138                   const std::string& value) {
139     return body(section, key, value);
140   };
141 };
142 extern struct btif_config_set_str btif_config_set_str;
143 // Name: btif_config_get_bin
144 // Params: const std::string& section, const std::string& key, uint8_t* value,
145 // size_t* length Returns: bool
146 struct btif_config_get_bin {
147   std::function<bool(const std::string& section, const std::string& key,
148                      uint8_t* value, size_t* length)>
149       body{[](const std::string& section, const std::string& key,
150               uint8_t* value, size_t* length) { return false; }};
operatorbtif_config_get_bin151   bool operator()(const std::string& section, const std::string& key,
152                   uint8_t* value, size_t* length) {
153     return body(section, key, value, length);
154   };
155 };
156 extern struct btif_config_get_bin btif_config_get_bin;
157 // Name: btif_config_get_bin_length
158 // Params: const std::string& section, const std::string& key
159 // Returns: size_t
160 struct btif_config_get_bin_length {
161   std::function<size_t(const std::string& section, const std::string& key)>
162       body{
163           [](const std::string& section, const std::string& key) { return 0; }};
operatorbtif_config_get_bin_length164   size_t operator()(const std::string& section, const std::string& key) {
165     return body(section, key);
166   };
167 };
168 extern struct btif_config_get_bin_length btif_config_get_bin_length;
169 // Name: btif_config_set_bin
170 // Params: const std::string& section, const std::string& key, const uint8_t*
171 // value, size_t length Returns: bool
172 struct btif_config_set_bin {
173   std::function<bool(const std::string& section, const std::string& key,
174                      const uint8_t* value, size_t length)>
175       body{[](const std::string& section, const std::string& key,
176               const uint8_t* value, size_t length) { return false; }};
operatorbtif_config_set_bin177   bool operator()(const std::string& section, const std::string& key,
178                   const uint8_t* value, size_t length) {
179     return body(section, key, value, length);
180   };
181 };
182 extern struct btif_config_set_bin btif_config_set_bin;
183 // Name: btif_config_get_paired_devices
184 // Params:
185 // Returns: std::vector<RawAddress>
186 struct btif_config_get_paired_devices {
187   std::vector<RawAddress> raw_addresses;
188   std::function<std::vector<RawAddress>()> body{
189       [this]() { return raw_addresses; }};
operatorbtif_config_get_paired_devices190   std::vector<RawAddress> operator()() { return body(); };
191 };
192 extern struct btif_config_get_paired_devices btif_config_get_paired_devices;
193 // Name: btif_config_remove
194 // Params: const std::string& section, const std::string& key
195 // Returns: bool
196 struct btif_config_remove {
197   std::function<bool(const std::string& section, const std::string& key)> body{
198       [](const std::string& section, const std::string& key) { return false; }};
operatorbtif_config_remove199   bool operator()(const std::string& section, const std::string& key) {
200     return body(section, key);
201   };
202 };
203 extern struct btif_config_remove btif_config_remove;
204 // Name: btif_config_clear
205 // Params: void
206 // Returns: bool
207 struct btif_config_clear {
208   std::function<bool(void)> body{[](void) { return false; }};
operatorbtif_config_clear209   bool operator()(void) { return body(); };
210 };
211 extern struct btif_config_clear btif_config_clear;
212 // Name: btif_debug_config_dump
213 // Params: int fd
214 // Returns: void
215 struct btif_debug_config_dump {
216   std::function<void(int fd)> body{[](int fd) {}};
operatorbtif_debug_config_dump217   void operator()(int fd) { body(fd); };
218 };
219 extern struct btif_debug_config_dump btif_debug_config_dump;
220 
221 }  // namespace btif_config
222 }  // namespace mock
223 }  // namespace test
224 
225 // END mockcify generation
226