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:13 20 * 21 * mockcify.pl ver 0.2 22 */ 23 24 #include <map> 25 #include <string> 26 27 extern std::map<std::string, int> mock_function_count_map; 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 "hci/include/hci_layer.h" 37 38 // Mocked compile conditionals, if any 39 #ifndef UNUSED_ATTR 40 #define UNUSED_ATTR 41 #endif 42 43 namespace test { 44 namespace mock { 45 namespace hci_layer { 46 47 // Shared state between mocked functions and tests 48 // Name: initialization_complete 49 // Params: 50 // Returns: void 51 struct initialization_complete { 52 std::function<void()> body{[]() {}}; operatorinitialization_complete53 void operator()() { body(); }; 54 }; 55 extern struct initialization_complete initialization_complete; 56 // Name: hci_event_received 57 // Params: const base::Location& from_here, BT_HDR* packet 58 // Returns: void 59 struct hci_event_received { 60 std::function<void(const base::Location& from_here, BT_HDR* packet)> body{ 61 [](const base::Location& from_here, BT_HDR* packet) {}}; operatorhci_event_received62 void operator()(const base::Location& from_here, BT_HDR* packet) { 63 body(from_here, packet); 64 }; 65 }; 66 extern struct hci_event_received hci_event_received; 67 // Name: acl_event_received 68 // Params: BT_HDR* packet 69 // Returns: void 70 struct acl_event_received { 71 std::function<void(BT_HDR* packet)> body{[](BT_HDR* packet) {}}; operatoracl_event_received72 void operator()(BT_HDR* packet) { body(packet); }; 73 }; 74 extern struct acl_event_received acl_event_received; 75 // Name: sco_data_received 76 // Params: BT_HDR* packet 77 // Returns: void 78 struct sco_data_received { 79 std::function<void(BT_HDR* packet)> body{[](BT_HDR* packet) {}}; operatorsco_data_received80 void operator()(BT_HDR* packet) { body(packet); }; 81 }; 82 extern struct sco_data_received sco_data_received; 83 // Name: iso_data_received 84 // Params: BT_HDR* packet 85 // Returns: void 86 struct iso_data_received { 87 std::function<void(BT_HDR* packet)> body{[](BT_HDR* packet) {}}; operatoriso_data_received88 void operator()(BT_HDR* packet) { body(packet); }; 89 }; 90 extern struct iso_data_received iso_data_received; 91 // Name: hal_service_died 92 // Params: 93 // Returns: void 94 struct hal_service_died { 95 std::function<void()> body{[]() {}}; operatorhal_service_died96 void operator()() { body(); }; 97 }; 98 extern struct hal_service_died hal_service_died; 99 // Name: process_command_credits 100 // Params: int credits 101 // Returns: void 102 struct process_command_credits { 103 std::function<void(int credits)> body{[](int credits) {}}; operatorprocess_command_credits104 void operator()(int credits) { body(credits); }; 105 }; 106 extern struct process_command_credits process_command_credits; 107 // Name: hci_is_root_inflammation_event_received 108 // Params: 109 // Returns: bool 110 struct hci_is_root_inflammation_event_received { 111 std::function<bool()> body{[]() { return false; }}; operatorhci_is_root_inflammation_event_received112 bool operator()() { return body(); }; 113 }; 114 extern struct hci_is_root_inflammation_event_received 115 hci_is_root_inflammation_event_received; 116 // Name: handle_root_inflammation_event 117 // Params: 118 // Returns: void 119 struct handle_root_inflammation_event { 120 std::function<void()> body{[]() {}}; operatorhandle_root_inflammation_event121 void operator()() { body(); }; 122 }; 123 extern struct handle_root_inflammation_event handle_root_inflammation_event; 124 // Name: hci_layer_cleanup_interface 125 // Params: 126 // Returns: void 127 struct hci_layer_cleanup_interface { 128 std::function<void()> body{[]() {}}; operatorhci_layer_cleanup_interface129 void operator()() { body(); }; 130 }; 131 extern struct hci_layer_cleanup_interface hci_layer_cleanup_interface; 132 // Name: hci_layer_get_interface 133 // Params: 134 // Returns: const hci_t* 135 struct hci_layer_get_interface { 136 hci_t* hci; 137 std::function<const hci_t*()> body{[this]() { return hci; }}; operatorhci_layer_get_interface138 const hci_t* operator()() { return body(); }; 139 }; 140 extern struct hci_layer_get_interface hci_layer_get_interface; 141 // Name: hci_layer_get_test_interface 142 // Params: const allocator_t* buffer_allocator_interface, const btsnoop_t* 143 // btsnoop_interface, const packet_fragmenter_t* packet_fragmenter_interface 144 // Returns: const hci_t* 145 struct hci_layer_get_test_interface { 146 std::function<const hci_t*( 147 const allocator_t* buffer_allocator_interface, 148 const btsnoop_t* btsnoop_interface, 149 const packet_fragmenter_t* packet_fragmenter_interface)> 150 body{[](const allocator_t* buffer_allocator_interface, 151 const btsnoop_t* btsnoop_interface, 152 const packet_fragmenter_t* packet_fragmenter_interface) { 153 return nullptr; 154 }}; operatorhci_layer_get_test_interface155 const hci_t* operator()( 156 const allocator_t* buffer_allocator_interface, 157 const btsnoop_t* btsnoop_interface, 158 const packet_fragmenter_t* packet_fragmenter_interface) { 159 return body(buffer_allocator_interface, btsnoop_interface, 160 packet_fragmenter_interface); 161 }; 162 }; 163 extern struct hci_layer_get_test_interface hci_layer_get_test_interface; 164 165 } // namespace hci_layer 166 } // namespace mock 167 } // namespace test 168 169 // END mockcify generation 170