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:3 20 * 21 * mockcify.pl ver 0.2 22 */ 23 24 #include <cstdint> 25 #include <functional> 26 #include <map> 27 #include <string> 28 29 extern std::map<std::string, int> mock_function_count_map; 30 31 // Original included files, if any 32 // NOTE: Since this is a mock file with mock definitions some number of 33 // include files may not be required. The include-what-you-use 34 // still applies, but crafting proper inclusion is out of scope 35 // for this effort. This compilation unit may compile as-is, or 36 // may need attention to prune the inclusion set. 37 #include <base/logging.h> 38 #include <hardware/bluetooth.h> 39 #include "bt_common.h" 40 #include "btcore/include/module.h" 41 #include "bte.h" 42 #include "btif/include/btif_config.h" 43 #include "btu.h" 44 #include "device/include/interop.h" 45 #include "hci/include/btsnoop.h" 46 #include "hci/include/hci_layer.h" 47 #include "main/shim/hci_layer.h" 48 #include "main/shim/shim.h" 49 #include "osi/include/log.h" 50 #include "osi/include/osi.h" 51 #include "stack_config.h" 52 53 // Mocked compile conditionals, if any 54 #ifndef UNUSED_ATTR 55 #define UNUSED_ATTR 56 #endif 57 58 namespace test { 59 namespace mock { 60 namespace main_bte { 61 62 // Shared state between mocked functions and tests 63 // Name: post_to_main_message_loop 64 // Params: const base::Location& from_here, BT_HDR* p_msg 65 // Returns: void 66 struct post_to_main_message_loop { 67 std::function<void(const base::Location& from_here, BT_HDR* p_msg)> body{ 68 [](const base::Location& from_here, BT_HDR* p_msg) {}}; operatorpost_to_main_message_loop69 void operator()(const base::Location& from_here, BT_HDR* p_msg) { 70 body(from_here, p_msg); 71 }; 72 }; 73 extern struct post_to_main_message_loop post_to_main_message_loop; 74 // Name: bte_main_init 75 // Params: void 76 // Returns: void 77 struct bte_main_init { 78 std::function<void(void)> body{[](void) {}}; operatorbte_main_init79 void operator()(void) { body(); }; 80 }; 81 extern struct bte_main_init bte_main_init; 82 // Name: bte_main_hci_send 83 // Params: BT_HDR* p_msg, uint16_t event 84 // Returns: void 85 struct bte_main_hci_send { 86 std::function<void(BT_HDR* p_msg, uint16_t event)> body{ 87 [](BT_HDR* p_msg, uint16_t event) {}}; operatorbte_main_hci_send88 void operator()(BT_HDR* p_msg, uint16_t event) { body(p_msg, event); }; 89 }; 90 extern struct bte_main_hci_send bte_main_hci_send; 91 92 } // namespace main_bte 93 } // namespace mock 94 } // namespace test 95 96 // END mockcify generation 97