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 */) { return false; }}; operatorbtif_get_device_clockoffset46 bool operator()(const RawAddress& bda, int* p_clock_offset) { return body(bda, p_clock_offset); } 47 }; 48 // Name: btif_set_device_clockoffset 49 // Params: const RawAddress& bda, int* p_clock_offset 50 // Returns: bool 51 struct btif_set_device_clockoffset { 52 std::function<bool(const RawAddress& bda, int clock_offset)> body{ 53 [](const RawAddress& /* bda */, int /* clock_offset */) { return false; }}; operatorbtif_set_device_clockoffset54 bool operator()(const RawAddress& bda, int clock_offset) { return body(bda, clock_offset); } 55 }; 56 // Name: btif_config_exist 57 // Params: const std::string& section, const std::string& key 58 // Returns: bool 59 struct btif_config_exist { 60 std::function<bool(const std::string& section, const std::string& key)> body{ 61 [](const std::string& /* section */, const std::string& /* key */) { return false; }}; operatorbtif_config_exist62 bool operator()(const std::string& section, const std::string& key) { return body(section, key); } 63 }; 64 extern struct btif_config_exist btif_config_exist; 65 // Name: btif_config_get_int 66 // Params: const std::string& section, const std::string& key, int* value 67 // Returns: bool 68 struct btif_config_get_int { 69 std::function<bool(const std::string& section, const std::string& key, int* value)> body{ 70 [](const std::string& /* section */, const std::string& /* key */, int* /* value */) { 71 return false; 72 }}; operatorbtif_config_get_int73 bool operator()(const std::string& section, const std::string& key, int* value) { 74 return body(section, key, value); 75 } 76 }; 77 extern struct btif_config_get_int btif_config_get_int; 78 // Name: btif_config_set_int 79 // Params: const std::string& section, const std::string& key, int value 80 // Returns: bool 81 struct btif_config_set_int { 82 std::function<bool(const std::string& section, const std::string& key, int value)> body{ 83 [](const std::string& /* section */, const std::string& /* key */, int /* value */) { 84 return false; 85 }}; operatorbtif_config_set_int86 bool operator()(const std::string& section, const std::string& key, int value) { 87 return body(section, key, value); 88 } 89 }; 90 extern struct btif_config_set_int btif_config_set_int; 91 // Name: btif_config_get_uint64 92 // Params: const std::string& section, const std::string& key, uint64_t* value 93 // Returns: bool 94 struct btif_config_get_uint64 { 95 std::function<bool(const std::string& section, const std::string& key, uint64_t* value)> body{ 96 [](const std::string& /* section */, const std::string& /* key */, 97 uint64_t* /* value */) { return false; }}; operatorbtif_config_get_uint6498 bool operator()(const std::string& section, const std::string& key, uint64_t* value) { 99 return body(section, key, value); 100 } 101 }; 102 extern struct btif_config_get_uint64 btif_config_get_uint64; 103 // Name: btif_config_set_uint64 104 // Params: const std::string& section, const std::string& key, uint64_t value 105 // Returns: bool 106 struct btif_config_set_uint64 { 107 std::function<bool(const std::string& section, const std::string& key, uint64_t value)> body{ 108 [](const std::string& /* section */, const std::string& /* key */, uint64_t /* value */) { 109 return false; 110 }}; operatorbtif_config_set_uint64111 bool operator()(const std::string& section, const std::string& key, uint64_t value) { 112 return body(section, key, value); 113 } 114 }; 115 extern struct btif_config_set_uint64 btif_config_set_uint64; 116 // Name: btif_config_get_str 117 // Params: const std::string& section, const std::string& key, char* value, int* 118 // size_bytes Returns: bool 119 struct btif_config_get_str { 120 std::function<bool(const std::string& section, const std::string& key, char* value, 121 int* size_bytes)> 122 body{[](const std::string& /* section */, const std::string& /* key */, char* /* value */, 123 int* /* size_bytes */) { return false; }}; operatorbtif_config_get_str124 bool operator()(const std::string& section, const std::string& key, char* value, 125 int* size_bytes) { 126 return body(section, key, value, size_bytes); 127 } 128 }; 129 extern struct btif_config_get_str btif_config_get_str; 130 // Name: btif_config_set_str 131 // Params: const std::string& section, const std::string& key, const 132 // std::string& value Returns: bool 133 struct btif_config_set_str { 134 std::function<bool(const std::string& section, const std::string& key, 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, const std::string& value) { 138 return body(section, key, value); 139 } 140 }; 141 extern struct btif_config_set_str btif_config_set_str; 142 // Name: btif_config_get_bin 143 // Params: const std::string& section, const std::string& key, uint8_t* value, 144 // size_t* length Returns: bool 145 struct btif_config_get_bin { 146 std::function<bool(const std::string& section, const std::string& key, uint8_t* value, 147 size_t* length)> 148 body{[](const std::string& /* section */, const std::string& /* key */, 149 uint8_t* /* value */, size_t* /* length */) { return false; }}; operatorbtif_config_get_bin150 bool operator()(const std::string& section, const std::string& key, uint8_t* value, 151 size_t* length) { 152 return body(section, key, value, length); 153 } 154 }; 155 extern struct btif_config_get_bin btif_config_get_bin; 156 // Name: btif_config_get_bin_length 157 // Params: const std::string& section, const std::string& key 158 // Returns: size_t 159 struct btif_config_get_bin_length { 160 std::function<size_t(const std::string& section, const std::string& key)> body{ 161 [](const std::string& /* section */, const std::string& /* key */) { return 0; }}; operatorbtif_config_get_bin_length162 size_t operator()(const std::string& section, const std::string& key) { 163 return body(section, key); 164 } 165 }; 166 extern struct btif_config_get_bin_length btif_config_get_bin_length; 167 // Name: btif_config_set_bin 168 // Params: const std::string& section, const std::string& key, const uint8_t* 169 // value, size_t length Returns: bool 170 struct btif_config_set_bin { 171 std::function<bool(const std::string& section, const std::string& key, const uint8_t* value, 172 size_t length)> 173 body{[](const std::string& /* section */, const std::string& /* key */, 174 const uint8_t* /* value */, size_t /* length */) { return false; }}; operatorbtif_config_set_bin175 bool operator()(const std::string& section, const std::string& key, const uint8_t* value, 176 size_t length) { 177 return body(section, key, value, length); 178 } 179 }; 180 extern struct btif_config_set_bin btif_config_set_bin; 181 // Name: btif_config_get_paired_devices 182 // Params: 183 // Returns: std::vector<RawAddress> 184 struct btif_config_get_paired_devices { 185 std::vector<RawAddress> raw_addresses; 186 std::function<std::vector<RawAddress>()> body{[this]() { return raw_addresses; }}; operatorbtif_config_get_paired_devices187 std::vector<RawAddress> operator()() { return body(); } 188 }; 189 extern struct btif_config_get_paired_devices btif_config_get_paired_devices; 190 // Name: btif_config_remove 191 // Params: const std::string& section, const std::string& key 192 // Returns: bool 193 struct btif_config_remove { 194 std::function<bool(const std::string& section, const std::string& key)> body{ 195 [](const std::string& /* section */, const std::string& /* key */) { return false; }}; operatorbtif_config_remove196 bool operator()(const std::string& section, const std::string& key) { return body(section, key); } 197 }; 198 extern struct btif_config_remove btif_config_remove; 199 // Name: btif_config_remove_device 200 // Params: const std::string& section 201 // Returns: void 202 struct btif_config_remove_device { 203 std::function<void(const std::string& section)> body{ 204 [](const std::string& /* section */) { return; }}; operatorbtif_config_remove_device205 void operator()(const std::string& /* section */) { return; } 206 }; 207 extern struct btif_config_remove_device btif_config_remove_device; 208 // Name: btif_config_clear 209 // Params: void 210 // Returns: bool 211 struct btif_config_clear { 212 std::function<bool(void)> body{[](void) { return false; }}; operatorbtif_config_clear213 bool operator()(void) { return body(); } 214 }; 215 extern struct btif_config_clear btif_config_clear; 216 217 } // namespace btif_config 218 } // namespace mock 219 } // namespace test 220 221 // END mockcify generation 222