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 <cstdint> 25 #include <functional> 26 #include <string> 27 #include <vector> 28 29 // Original included files, if any 30 31 #include "types/raw_address.h" 32 33 // Mocked compile conditionals, if any 34 35 namespace test { 36 namespace mock { 37 namespace btif_config { 38 39 // Shared state between mocked functions and tests 40 // Name: btif_get_device_clockoffset 41 // Params: const RawAddress& bda, int* p_clock_offset 42 // Returns: bool 43 struct btif_get_device_clockoffset { 44 std::function<bool(const RawAddress& bda, int* p_clock_offset)> body{ 45 [](const RawAddress& /* bda */, int* /* p_clock_offset */) { 46 return false; 47 }}; operatorbtif_get_device_clockoffset48 bool operator()(const RawAddress& bda, int* p_clock_offset) { 49 return body(bda, p_clock_offset); 50 }; 51 }; 52 // Name: btif_set_device_clockoffset 53 // Params: const RawAddress& bda, int* p_clock_offset 54 // Returns: bool 55 struct btif_set_device_clockoffset { 56 std::function<bool(const RawAddress& bda, int clock_offset)> body{ 57 [](const RawAddress& /* bda */, int /* clock_offset */) { 58 return false; 59 }}; operatorbtif_set_device_clockoffset60 bool operator()(const RawAddress& bda, int clock_offset) { 61 return body(bda, clock_offset); 62 }; 63 }; 64 // Name: btif_config_exist 65 // Params: const std::string& section, const std::string& key 66 // Returns: bool 67 struct btif_config_exist { 68 std::function<bool(const std::string& section, const std::string& key)> body{ 69 [](const std::string& /* section */, const std::string& /* key */) { 70 return false; 71 }}; operatorbtif_config_exist72 bool operator()(const std::string& section, const std::string& key) { 73 return body(section, key); 74 }; 75 }; 76 extern struct btif_config_exist btif_config_exist; 77 // Name: btif_config_get_int 78 // Params: const std::string& section, const std::string& key, int* value 79 // Returns: bool 80 struct btif_config_get_int { 81 std::function<bool(const std::string& section, const std::string& key, 82 int* value)> 83 body{[](const std::string& /* section */, const std::string& /* key */, 84 int* /* value */) { return false; }}; operatorbtif_config_get_int85 bool operator()(const std::string& section, const std::string& key, 86 int* value) { 87 return body(section, key, value); 88 }; 89 }; 90 extern struct btif_config_get_int btif_config_get_int; 91 // Name: btif_config_set_int 92 // Params: const std::string& section, const std::string& key, int value 93 // Returns: bool 94 struct btif_config_set_int { 95 std::function<bool(const std::string& section, const std::string& key, 96 int value)> 97 body{[](const std::string& /* section */, const std::string& /* key */, 98 int /* value */) { return false; }}; operatorbtif_config_set_int99 bool operator()(const std::string& section, const std::string& key, 100 int value) { 101 return body(section, key, value); 102 }; 103 }; 104 extern struct btif_config_set_int btif_config_set_int; 105 // Name: btif_config_get_uint64 106 // Params: const std::string& section, const std::string& key, uint64_t* value 107 // Returns: bool 108 struct btif_config_get_uint64 { 109 std::function<bool(const std::string& section, const std::string& key, 110 uint64_t* value)> 111 body{[](const std::string& /* section */, const std::string& /* key */, 112 uint64_t* /* value */) { return false; }}; operatorbtif_config_get_uint64113 bool operator()(const std::string& section, const std::string& key, 114 uint64_t* value) { 115 return body(section, key, value); 116 }; 117 }; 118 extern struct btif_config_get_uint64 btif_config_get_uint64; 119 // Name: btif_config_set_uint64 120 // Params: const std::string& section, const std::string& key, uint64_t value 121 // Returns: bool 122 struct btif_config_set_uint64 { 123 std::function<bool(const std::string& section, const std::string& key, 124 uint64_t value)> 125 body{[](const std::string& /* section */, const std::string& /* key */, 126 uint64_t /* value */) { return false; }}; operatorbtif_config_set_uint64127 bool operator()(const std::string& section, const std::string& key, 128 uint64_t value) { 129 return body(section, key, value); 130 }; 131 }; 132 extern struct btif_config_set_uint64 btif_config_set_uint64; 133 // Name: btif_config_get_str 134 // Params: const std::string& section, const std::string& key, char* value, int* 135 // size_bytes Returns: bool 136 struct btif_config_get_str { 137 std::function<bool(const std::string& section, const std::string& key, 138 char* value, int* size_bytes)> 139 body{[](const std::string& /* section */, const std::string& /* key */, 140 char* /* value */, int* /* size_bytes */) { return false; }}; operatorbtif_config_get_str141 bool operator()(const std::string& section, const std::string& key, 142 char* value, int* size_bytes) { 143 return body(section, key, value, size_bytes); 144 }; 145 }; 146 extern struct btif_config_get_str btif_config_get_str; 147 // Name: btif_config_set_str 148 // Params: const std::string& section, const std::string& key, const 149 // std::string& value Returns: bool 150 struct btif_config_set_str { 151 std::function<bool(const std::string& section, const std::string& key, 152 const std::string& value)> 153 body{[](const std::string& /* section */, const std::string& /* key */, 154 const std::string& /* value */) { return false; }}; operatorbtif_config_set_str155 bool operator()(const std::string& section, const std::string& key, 156 const std::string& value) { 157 return body(section, key, value); 158 }; 159 }; 160 extern struct btif_config_set_str btif_config_set_str; 161 // Name: btif_config_get_bin 162 // Params: const std::string& section, const std::string& key, uint8_t* value, 163 // size_t* length Returns: bool 164 struct btif_config_get_bin { 165 std::function<bool(const std::string& section, const std::string& key, 166 uint8_t* value, size_t* length)> 167 body{[](const std::string& /* section */, const std::string& /* key */, 168 uint8_t* /* value */, size_t* /* length */) { return false; }}; operatorbtif_config_get_bin169 bool operator()(const std::string& section, const std::string& key, 170 uint8_t* value, size_t* length) { 171 return body(section, key, value, length); 172 }; 173 }; 174 extern struct btif_config_get_bin btif_config_get_bin; 175 // Name: btif_config_get_bin_length 176 // Params: const std::string& section, const std::string& key 177 // Returns: size_t 178 struct btif_config_get_bin_length { 179 std::function<size_t(const std::string& section, const std::string& key)> 180 body{[](const std::string& /* section */, const std::string& /* key */) { 181 return 0; 182 }}; operatorbtif_config_get_bin_length183 size_t operator()(const std::string& section, const std::string& key) { 184 return body(section, key); 185 }; 186 }; 187 extern struct btif_config_get_bin_length btif_config_get_bin_length; 188 // Name: btif_config_set_bin 189 // Params: const std::string& section, const std::string& key, const uint8_t* 190 // value, size_t length Returns: bool 191 struct btif_config_set_bin { 192 std::function<bool(const std::string& section, const std::string& key, 193 const uint8_t* value, size_t length)> 194 body{[](const std::string& /* section */, const std::string& /* key */, 195 const uint8_t* /* value */, 196 size_t /* length */) { return false; }}; operatorbtif_config_set_bin197 bool operator()(const std::string& section, const std::string& key, 198 const uint8_t* value, size_t length) { 199 return body(section, key, value, length); 200 }; 201 }; 202 extern struct btif_config_set_bin btif_config_set_bin; 203 // Name: btif_config_get_paired_devices 204 // Params: 205 // Returns: std::vector<RawAddress> 206 struct btif_config_get_paired_devices { 207 std::vector<RawAddress> raw_addresses; 208 std::function<std::vector<RawAddress>()> body{ 209 [this]() { return raw_addresses; }}; operatorbtif_config_get_paired_devices210 std::vector<RawAddress> operator()() { return body(); }; 211 }; 212 extern struct btif_config_get_paired_devices btif_config_get_paired_devices; 213 // Name: btif_config_remove 214 // Params: const std::string& section, const std::string& key 215 // Returns: bool 216 struct btif_config_remove { 217 std::function<bool(const std::string& section, const std::string& key)> body{ 218 [](const std::string& /* section */, const std::string& /* key */) { 219 return false; 220 }}; operatorbtif_config_remove221 bool operator()(const std::string& section, const std::string& key) { 222 return body(section, key); 223 }; 224 }; 225 extern struct btif_config_remove btif_config_remove; 226 // Name: btif_config_remove_device 227 // Params: const std::string& section 228 // Returns: void 229 struct btif_config_remove_device { 230 std::function<void(const std::string& section)> body{ 231 [](const std::string& /* section */) { return; }}; operatorbtif_config_remove_device232 void operator()(const std::string& /* section */) { return; }; 233 }; 234 extern struct btif_config_remove_device btif_config_remove_device; 235 // Name: btif_config_clear 236 // Params: void 237 // Returns: bool 238 struct btif_config_clear { 239 std::function<bool(void)> body{[](void) { return false; }}; operatorbtif_config_clear240 bool operator()(void) { return body(); }; 241 }; 242 extern struct btif_config_clear btif_config_clear; 243 244 } // namespace btif_config 245 } // namespace mock 246 } // namespace test 247 248 // END mockcify generation 249