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:34 21 * 22 * mockcify.pl ver 0.6.2 23 */ 24 25 #include <cstdint> 26 #include <functional> 27 28 // Original included files, if any 29 30 #include "device/include/interop.h" 31 #include "osi/include/list.h" 32 #include "types/raw_address.h" 33 34 // Original usings 35 36 // Mocked compile conditionals, if any 37 38 namespace test { 39 namespace mock { 40 namespace device_interop { 41 42 // Shared state between mocked functions and tests 43 // Name: interop_database_add 44 // Params: const uint16_t feature, const RawAddress* addr, size_t length 45 // Return: void 46 struct interop_database_add { 47 std::function<void(const uint16_t feature, const RawAddress* addr, 48 size_t length)> 49 body{[](const uint16_t /* feature */, const RawAddress* /* addr */, 50 size_t /* length */) {}}; operatorinterop_database_add51 void operator()(const uint16_t feature, const RawAddress* addr, 52 size_t length) { 53 body(feature, addr, length); 54 }; 55 }; 56 extern struct interop_database_add interop_database_add; 57 58 // Name: interop_database_add_addr 59 // Params: const uint16_t feature, const RawAddress* addr, size_t length 60 // Return: void 61 struct interop_database_add_addr { 62 std::function<void(const uint16_t feature, const RawAddress* addr, 63 size_t length)> 64 body{[](const uint16_t /* feature */, const RawAddress* /* addr */, 65 size_t /* length */) {}}; operatorinterop_database_add_addr66 void operator()(const uint16_t feature, const RawAddress* addr, 67 size_t length) { 68 body(feature, addr, length); 69 }; 70 }; 71 extern struct interop_database_add_addr interop_database_add_addr; 72 73 // Name: interop_database_add_addr_lmp_version 74 // Params: const interop_feature_t feature, const RawAddress* addr, uint8_t 75 // lmp_ver, uint16_t lmp_sub_ver Return: void 76 struct interop_database_add_addr_lmp_version { 77 std::function<void(const interop_feature_t feature, const RawAddress* addr, 78 uint8_t lmp_ver, uint16_t lmp_sub_ver)> 79 body{[](const interop_feature_t /* feature */, 80 const RawAddress* /* addr */, uint8_t /* lmp_ver */, 81 uint16_t /* lmp_sub_ver */) {}}; operatorinterop_database_add_addr_lmp_version82 void operator()(const interop_feature_t feature, const RawAddress* addr, 83 uint8_t lmp_ver, uint16_t lmp_sub_ver) { 84 body(feature, addr, lmp_ver, lmp_sub_ver); 85 }; 86 }; 87 extern struct interop_database_add_addr_lmp_version 88 interop_database_add_addr_lmp_version; 89 90 // Name: interop_database_add_addr_max_lat 91 // Params: const interop_feature_t feature, const RawAddress* addr, uint16_t 92 // max_lat Return: void 93 struct interop_database_add_addr_max_lat { 94 std::function<void(const interop_feature_t feature, const RawAddress* addr, 95 uint16_t max_lat)> 96 body{[](const interop_feature_t /* feature */, 97 const RawAddress* /* addr */, uint16_t /* max_lat */) {}}; operatorinterop_database_add_addr_max_lat98 void operator()(const interop_feature_t feature, const RawAddress* addr, 99 uint16_t max_lat) { 100 body(feature, addr, max_lat); 101 }; 102 }; 103 extern struct interop_database_add_addr_max_lat 104 interop_database_add_addr_max_lat; 105 106 // Name: interop_database_add_manufacturer 107 // Params: const interop_feature_t feature, uint16_t manufacturer 108 // Return: void 109 struct interop_database_add_manufacturer { 110 std::function<void(const interop_feature_t feature, uint16_t manufacturer)> 111 body{[](const interop_feature_t /* feature */, 112 uint16_t /* manufacturer */) {}}; operatorinterop_database_add_manufacturer113 void operator()(const interop_feature_t feature, uint16_t manufacturer) { 114 body(feature, manufacturer); 115 }; 116 }; 117 extern struct interop_database_add_manufacturer 118 interop_database_add_manufacturer; 119 120 // Name: interop_database_add_name 121 // Params: const uint16_t feature, const char* name 122 // Return: void 123 struct interop_database_add_name { 124 std::function<void(const uint16_t feature, const char* name)> body{ 125 [](const uint16_t /* feature */, const char* /* name */) {}}; operatorinterop_database_add_name126 void operator()(const uint16_t feature, const char* name) { 127 body(feature, name); 128 }; 129 }; 130 extern struct interop_database_add_name interop_database_add_name; 131 132 // Name: interop_database_add_version 133 // Params: const interop_feature_t feature, uint16_t version 134 // Return: void 135 struct interop_database_add_version { 136 std::function<void(const interop_feature_t feature, uint16_t version)> body{ 137 [](const interop_feature_t /* feature */, uint16_t /* version */) {}}; operatorinterop_database_add_version138 void operator()(const interop_feature_t feature, uint16_t version) { 139 body(feature, version); 140 }; 141 }; 142 extern struct interop_database_add_version interop_database_add_version; 143 144 // Name: interop_database_add_vndr_prdt 145 // Params: const interop_feature_t feature, uint16_t vendor_id, uint16_t 146 // product_id Return: void 147 struct interop_database_add_vndr_prdt { 148 std::function<void(const interop_feature_t feature, uint16_t vendor_id, 149 uint16_t product_id)> 150 body{[](const interop_feature_t /* feature */, uint16_t /* vendor_id */, 151 uint16_t /* product_id */) {}}; operatorinterop_database_add_vndr_prdt152 void operator()(const interop_feature_t feature, uint16_t vendor_id, 153 uint16_t product_id) { 154 body(feature, vendor_id, product_id); 155 }; 156 }; 157 extern struct interop_database_add_vndr_prdt interop_database_add_vndr_prdt; 158 159 // Name: interop_database_clear 160 // Params: 161 // Return: void 162 struct interop_database_clear { 163 std::function<void()> body{[]() {}}; operatorinterop_database_clear164 void operator()() { body(); }; 165 }; 166 extern struct interop_database_clear interop_database_clear; 167 168 // Name: interop_database_match_addr 169 // Params: const interop_feature_t feature, const RawAddress* addr 170 // Return: bool 171 struct interop_database_match_addr { 172 static bool return_value; 173 std::function<bool(const interop_feature_t feature, const RawAddress* addr)> 174 body{[](const interop_feature_t /* feature */, 175 const RawAddress* /* addr */) { return return_value; }}; operatorinterop_database_match_addr176 bool operator()(const interop_feature_t feature, const RawAddress* addr) { 177 return body(feature, addr); 178 }; 179 }; 180 extern struct interop_database_match_addr interop_database_match_addr; 181 182 // Name: interop_database_match_addr_get_lmp_ver 183 // Params: const interop_feature_t feature, const RawAddress* addr, uint8_t* 184 // lmp_ver, uint16_t* lmp_sub_ver Return: bool 185 struct interop_database_match_addr_get_lmp_ver { 186 static bool return_value; 187 std::function<bool(const interop_feature_t feature, const RawAddress* addr, 188 uint8_t* lmp_ver, uint16_t* lmp_sub_ver)> 189 body{[](const interop_feature_t /* feature */, 190 const RawAddress* /* addr */, uint8_t* /* lmp_ver */, 191 uint16_t* /* lmp_sub_ver */) { return return_value; }}; operatorinterop_database_match_addr_get_lmp_ver192 bool operator()(const interop_feature_t feature, const RawAddress* addr, 193 uint8_t* lmp_ver, uint16_t* lmp_sub_ver) { 194 return body(feature, addr, lmp_ver, lmp_sub_ver); 195 }; 196 }; 197 extern struct interop_database_match_addr_get_lmp_ver 198 interop_database_match_addr_get_lmp_ver; 199 200 // Name: interop_database_match_addr_get_max_lat 201 // Params: const interop_feature_t feature, const RawAddress* addr, uint16_t* 202 // max_lat Return: bool 203 struct interop_database_match_addr_get_max_lat { 204 static bool return_value; 205 std::function<bool(const interop_feature_t feature, const RawAddress* addr, 206 uint16_t* max_lat)> 207 body{[](const interop_feature_t /* feature */, 208 const RawAddress* /* addr */, 209 uint16_t* /* max_lat */) { return return_value; }}; operatorinterop_database_match_addr_get_max_lat210 bool operator()(const interop_feature_t feature, const RawAddress* addr, 211 uint16_t* max_lat) { 212 return body(feature, addr, max_lat); 213 }; 214 }; 215 extern struct interop_database_match_addr_get_max_lat 216 interop_database_match_addr_get_max_lat; 217 218 // Name: interop_database_match_manufacturer 219 // Params: const interop_feature_t feature, uint16_t manufacturer 220 // Return: bool 221 struct interop_database_match_manufacturer { 222 static bool return_value; 223 std::function<bool(const interop_feature_t feature, uint16_t manufacturer)> 224 body{[](const interop_feature_t /* feature */, 225 uint16_t /* manufacturer */) { return return_value; }}; operatorinterop_database_match_manufacturer226 bool operator()(const interop_feature_t feature, uint16_t manufacturer) { 227 return body(feature, manufacturer); 228 }; 229 }; 230 extern struct interop_database_match_manufacturer 231 interop_database_match_manufacturer; 232 233 // Name: interop_database_match_name 234 // Params: const interop_feature_t feature, const char* name 235 // Return: bool 236 struct interop_database_match_name { 237 static bool return_value; 238 std::function<bool(const interop_feature_t feature, const char* name)> body{ 239 [](const interop_feature_t /* feature */, const char* /* name */) { 240 return return_value; 241 }}; operatorinterop_database_match_name242 bool operator()(const interop_feature_t feature, const char* name) { 243 return body(feature, name); 244 }; 245 }; 246 extern struct interop_database_match_name interop_database_match_name; 247 248 // Name: interop_database_match_version 249 // Params: const interop_feature_t feature, uint16_t version 250 // Return: bool 251 struct interop_database_match_version { 252 static bool return_value; 253 std::function<bool(const interop_feature_t feature, uint16_t version)> body{ 254 [](const interop_feature_t /* feature */, uint16_t /* version */) { 255 return return_value; 256 }}; operatorinterop_database_match_version257 bool operator()(const interop_feature_t feature, uint16_t version) { 258 return body(feature, version); 259 }; 260 }; 261 extern struct interop_database_match_version interop_database_match_version; 262 263 // Name: interop_database_match_vndr_prdt 264 // Params: const interop_feature_t feature, uint16_t vendor_id, uint16_t 265 // product_id Return: bool 266 struct interop_database_match_vndr_prdt { 267 static bool return_value; 268 std::function<bool(const interop_feature_t feature, uint16_t vendor_id, 269 uint16_t product_id)> 270 body{[](const interop_feature_t /* feature */, uint16_t /* vendor_id */, 271 uint16_t /* product_id */) { return return_value; }}; operatorinterop_database_match_vndr_prdt272 bool operator()(const interop_feature_t feature, uint16_t vendor_id, 273 uint16_t product_id) { 274 return body(feature, vendor_id, product_id); 275 }; 276 }; 277 extern struct interop_database_match_vndr_prdt interop_database_match_vndr_prdt; 278 279 // Name: interop_database_remove_addr 280 // Params: const interop_feature_t feature, const RawAddress* addr 281 // Return: bool 282 struct interop_database_remove_addr { 283 static bool return_value; 284 std::function<bool(const interop_feature_t feature, const RawAddress* addr)> 285 body{[](const interop_feature_t /* feature */, 286 const RawAddress* /* addr */) { return return_value; }}; operatorinterop_database_remove_addr287 bool operator()(const interop_feature_t feature, const RawAddress* addr) { 288 return body(feature, addr); 289 }; 290 }; 291 extern struct interop_database_remove_addr interop_database_remove_addr; 292 293 // Name: interop_database_remove_addr_lmp_version 294 // Params: const interop_feature_t feature, const RawAddress* addr, uint8_t 295 // lmp_ver, uint16_t lmp_sub_ver Return: bool 296 struct interop_database_remove_addr_lmp_version { 297 static bool return_value; 298 std::function<bool(const interop_feature_t feature, const RawAddress* addr, 299 uint8_t lmp_ver, uint16_t lmp_sub_ver)> 300 body{[](const interop_feature_t /* feature */, 301 const RawAddress* /* addr */, uint8_t /* lmp_ver */, 302 uint16_t /* lmp_sub_ver */) { return return_value; }}; operatorinterop_database_remove_addr_lmp_version303 bool operator()(const interop_feature_t feature, const RawAddress* addr, 304 uint8_t lmp_ver, uint16_t lmp_sub_ver) { 305 return body(feature, addr, lmp_ver, lmp_sub_ver); 306 }; 307 }; 308 extern struct interop_database_remove_addr_lmp_version 309 interop_database_remove_addr_lmp_version; 310 311 // Name: interop_database_remove_addr_max_lat 312 // Params: const interop_feature_t feature, const RawAddress* addr, uint16_t 313 // max_lat Return: bool 314 struct interop_database_remove_addr_max_lat { 315 static bool return_value; 316 std::function<bool(const interop_feature_t feature, const RawAddress* addr, 317 uint16_t max_lat)> 318 body{[](const interop_feature_t /* feature */, 319 const RawAddress* /* addr */, 320 uint16_t /* max_lat */) { return return_value; }}; operatorinterop_database_remove_addr_max_lat321 bool operator()(const interop_feature_t feature, const RawAddress* addr, 322 uint16_t max_lat) { 323 return body(feature, addr, max_lat); 324 }; 325 }; 326 extern struct interop_database_remove_addr_max_lat 327 interop_database_remove_addr_max_lat; 328 329 // Name: interop_database_remove_feature 330 // Params: const interop_feature_t feature 331 // Return: bool 332 struct interop_database_remove_feature { 333 static bool return_value; 334 std::function<bool(const interop_feature_t feature)> body{ 335 [](const interop_feature_t /* feature */) { return return_value; }}; operatorinterop_database_remove_feature336 bool operator()(const interop_feature_t feature) { return body(feature); }; 337 }; 338 extern struct interop_database_remove_feature interop_database_remove_feature; 339 340 // Name: interop_database_remove_manufacturer 341 // Params: const interop_feature_t feature, uint16_t manufacturer 342 // Return: bool 343 struct interop_database_remove_manufacturer { 344 static bool return_value; 345 std::function<bool(const interop_feature_t feature, uint16_t manufacturer)> 346 body{[](const interop_feature_t /* feature */, 347 uint16_t /* manufacturer */) { return return_value; }}; operatorinterop_database_remove_manufacturer348 bool operator()(const interop_feature_t feature, uint16_t manufacturer) { 349 return body(feature, manufacturer); 350 }; 351 }; 352 extern struct interop_database_remove_manufacturer 353 interop_database_remove_manufacturer; 354 355 // Name: interop_database_remove_name 356 // Params: const interop_feature_t feature, const char* name 357 // Return: bool 358 struct interop_database_remove_name { 359 static bool return_value; 360 std::function<bool(const interop_feature_t feature, const char* name)> body{ 361 [](const interop_feature_t /* feature */, const char* /* name */) { 362 return return_value; 363 }}; operatorinterop_database_remove_name364 bool operator()(const interop_feature_t feature, const char* name) { 365 return body(feature, name); 366 }; 367 }; 368 extern struct interop_database_remove_name interop_database_remove_name; 369 370 // Name: interop_database_remove_version 371 // Params: const interop_feature_t feature, uint16_t version 372 // Return: bool 373 struct interop_database_remove_version { 374 static bool return_value; 375 std::function<bool(const interop_feature_t feature, uint16_t version)> body{ 376 [](const interop_feature_t /* feature */, uint16_t /* version */) { 377 return return_value; 378 }}; operatorinterop_database_remove_version379 bool operator()(const interop_feature_t feature, uint16_t version) { 380 return body(feature, version); 381 }; 382 }; 383 extern struct interop_database_remove_version interop_database_remove_version; 384 385 // Name: interop_database_remove_vndr_prdt 386 // Params: const interop_feature_t feature, uint16_t vendor_id, uint16_t 387 // product_id Return: bool 388 struct interop_database_remove_vndr_prdt { 389 static bool return_value; 390 std::function<bool(const interop_feature_t feature, uint16_t vendor_id, 391 uint16_t product_id)> 392 body{[](const interop_feature_t /* feature */, uint16_t /* vendor_id */, 393 uint16_t /* product_id */) { return return_value; }}; operatorinterop_database_remove_vndr_prdt394 bool operator()(const interop_feature_t feature, uint16_t vendor_id, 395 uint16_t product_id) { 396 return body(feature, vendor_id, product_id); 397 }; 398 }; 399 extern struct interop_database_remove_vndr_prdt 400 interop_database_remove_vndr_prdt; 401 402 // Name: interop_feature_name_to_feature_id 403 // Params: const char* feature_name 404 // Return: int 405 struct interop_feature_name_to_feature_id { 406 static int return_value; 407 std::function<int(const char* feature_name)> body{ 408 [](const char* /* feature_name */) { return return_value; }}; operatorinterop_feature_name_to_feature_id409 int operator()(const char* feature_name) { return body(feature_name); }; 410 }; 411 extern struct interop_feature_name_to_feature_id 412 interop_feature_name_to_feature_id; 413 414 // Name: interop_match_addr 415 // Params: const interop_feature_t feature, const RawAddress* addr 416 // Return: bool 417 struct interop_match_addr { 418 static bool return_value; 419 std::function<bool(const interop_feature_t feature, const RawAddress* addr)> 420 body{[](const interop_feature_t /* feature */, 421 const RawAddress* /* addr */) { return return_value; }}; operatorinterop_match_addr422 bool operator()(const interop_feature_t feature, const RawAddress* addr) { 423 return body(feature, addr); 424 }; 425 }; 426 extern struct interop_match_addr interop_match_addr; 427 428 // Name: interop_match_addr_get_max_lat 429 // Params: const interop_feature_t feature, const RawAddress* addr, uint16_t* 430 // max_lat Return: bool 431 struct interop_match_addr_get_max_lat { 432 static bool return_value; 433 std::function<bool(const interop_feature_t feature, const RawAddress* addr, 434 uint16_t* max_lat)> 435 body{[](const interop_feature_t /* feature */, 436 const RawAddress* /* addr */, 437 uint16_t* /* max_lat */) { return return_value; }}; operatorinterop_match_addr_get_max_lat438 bool operator()(const interop_feature_t feature, const RawAddress* addr, 439 uint16_t* max_lat) { 440 return body(feature, addr, max_lat); 441 }; 442 }; 443 extern struct interop_match_addr_get_max_lat interop_match_addr_get_max_lat; 444 445 // Name: interop_match_addr_or_name 446 // Params: const interop_feature_t feature, const RawAddress* addr, bt_status_t 447 // (*get_remote_device_property Return: bool 448 struct interop_match_addr_or_name { 449 static bool return_value; 450 std::function<bool(const interop_feature_t feature, const RawAddress* addr, 451 bt_status_t (*get_remote_device_property)( 452 const RawAddress*, bt_property_t*))> 453 body{[](const interop_feature_t /* feature */, 454 const RawAddress* /* addr */, 455 bt_status_t (* /* get_remote_device_property */)( 456 const RawAddress*, bt_property_t*)) { return return_value; }}; operatorinterop_match_addr_or_name457 bool operator()(const interop_feature_t feature, const RawAddress* addr, 458 bt_status_t (*get_remote_device_property)(const RawAddress*, 459 bt_property_t*)) { 460 return body(feature, addr, get_remote_device_property); 461 }; 462 }; 463 extern struct interop_match_addr_or_name interop_match_addr_or_name; 464 465 // Name: interop_match_manufacturer 466 // Params: const interop_feature_t feature, uint16_t manufacturer 467 // Return: bool 468 struct interop_match_manufacturer { 469 static bool return_value; 470 std::function<bool(const interop_feature_t feature, uint16_t manufacturer)> 471 body{[](const interop_feature_t /* feature */, 472 uint16_t /* manufacturer */) { return return_value; }}; operatorinterop_match_manufacturer473 bool operator()(const interop_feature_t feature, uint16_t manufacturer) { 474 return body(feature, manufacturer); 475 }; 476 }; 477 extern struct interop_match_manufacturer interop_match_manufacturer; 478 479 // Name: interop_match_name 480 // Params: const interop_feature_t feature, const char* name 481 // Return: bool 482 struct interop_match_name { 483 static bool return_value; 484 std::function<bool(const interop_feature_t feature, const char* name)> body{ 485 [](const interop_feature_t /* feature */, const char* /* name */) { 486 return return_value; 487 }}; operatorinterop_match_name488 bool operator()(const interop_feature_t feature, const char* name) { 489 return body(feature, name); 490 }; 491 }; 492 extern struct interop_match_name interop_match_name; 493 494 // Name: interop_match_vendor_product_ids 495 // Params: const interop_feature_t feature, uint16_t vendor_id, uint16_t 496 // product_id Return: bool 497 struct interop_match_vendor_product_ids { 498 static bool return_value; 499 std::function<bool(const interop_feature_t feature, uint16_t vendor_id, 500 uint16_t product_id)> 501 body{[](const interop_feature_t /* feature */, uint16_t /* vendor_id */, 502 uint16_t /* product_id */) { return return_value; }}; operatorinterop_match_vendor_product_ids503 bool operator()(const interop_feature_t feature, uint16_t vendor_id, 504 uint16_t product_id) { 505 return body(feature, vendor_id, product_id); 506 }; 507 }; 508 extern struct interop_match_vendor_product_ids interop_match_vendor_product_ids; 509 510 // Name: token_to_ul 511 // Params: char* token, uint16_t* ul 512 // Return: bool 513 struct token_to_ul { 514 static bool return_value; 515 std::function<bool(char* token, uint16_t* ul)> body{ 516 [](char* /* token */, uint16_t* /* ul */) { return return_value; }}; operatortoken_to_ul517 bool operator()(char* token, uint16_t* ul) { return body(token, ul); }; 518 }; 519 extern struct token_to_ul token_to_ul; 520 521 } // namespace device_interop 522 } // namespace mock 523 } // namespace test 524 525 // END mockcify generation 526