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 // Mock include file to share data between tests and mock
37 #include "test/mock/mock_hci_layer.h"
38 
39 // Mocked compile conditionals, if any
40 #ifndef UNUSED_ATTR
41 #define UNUSED_ATTR
42 #endif
43 
44 // Mocked internal structures, if any
45 typedef struct {
46 } waiting_command_t;
47 
48 namespace test {
49 namespace mock {
50 namespace hci_layer {
51 
52 // Function state capture and return values, if needed
53 struct initialization_complete initialization_complete;
54 struct hci_event_received hci_event_received;
55 struct acl_event_received acl_event_received;
56 struct sco_data_received sco_data_received;
57 struct iso_data_received iso_data_received;
58 struct hal_service_died hal_service_died;
59 struct process_command_credits process_command_credits;
60 struct hci_is_root_inflammation_event_received
61     hci_is_root_inflammation_event_received;
62 struct handle_root_inflammation_event handle_root_inflammation_event;
63 struct hci_layer_cleanup_interface hci_layer_cleanup_interface;
64 struct hci_layer_get_interface hci_layer_get_interface;
65 struct hci_layer_get_test_interface hci_layer_get_test_interface;
66 
67 }  // namespace hci_layer
68 }  // namespace mock
69 }  // namespace test
70 
71 // Mocked functions, if any
initialization_complete()72 void initialization_complete() {
73   mock_function_count_map[__func__]++;
74   test::mock::hci_layer::initialization_complete();
75 }
hci_event_received(const base::Location & from_here,BT_HDR * packet)76 void hci_event_received(const base::Location& from_here, BT_HDR* packet) {
77   mock_function_count_map[__func__]++;
78   test::mock::hci_layer::hci_event_received(from_here, packet);
79 }
acl_event_received(BT_HDR * packet)80 void acl_event_received(BT_HDR* packet) {
81   mock_function_count_map[__func__]++;
82   test::mock::hci_layer::acl_event_received(packet);
83 }
sco_data_received(BT_HDR * packet)84 void sco_data_received(BT_HDR* packet) {
85   mock_function_count_map[__func__]++;
86   test::mock::hci_layer::sco_data_received(packet);
87 }
iso_data_received(BT_HDR * packet)88 void iso_data_received(BT_HDR* packet) {
89   mock_function_count_map[__func__]++;
90   test::mock::hci_layer::iso_data_received(packet);
91 }
hal_service_died()92 void hal_service_died() {
93   mock_function_count_map[__func__]++;
94   test::mock::hci_layer::hal_service_died();
95 }
process_command_credits(int credits)96 void process_command_credits(int credits) {
97   mock_function_count_map[__func__]++;
98   test::mock::hci_layer::process_command_credits(credits);
99 }
hci_is_root_inflammation_event_received()100 bool hci_is_root_inflammation_event_received() {
101   mock_function_count_map[__func__]++;
102   return test::mock::hci_layer::hci_is_root_inflammation_event_received();
103 }
handle_root_inflammation_event()104 void handle_root_inflammation_event() {
105   mock_function_count_map[__func__]++;
106   test::mock::hci_layer::handle_root_inflammation_event();
107 }
hci_layer_cleanup_interface()108 void hci_layer_cleanup_interface() {
109   mock_function_count_map[__func__]++;
110   test::mock::hci_layer::hci_layer_cleanup_interface();
111 }
hci_layer_get_interface()112 const hci_t* hci_layer_get_interface() {
113   mock_function_count_map[__func__]++;
114   return test::mock::hci_layer::hci_layer_get_interface();
115 }
hci_layer_get_test_interface(const allocator_t * buffer_allocator_interface,const btsnoop_t * btsnoop_interface,const packet_fragmenter_t * packet_fragmenter_interface)116 const hci_t* hci_layer_get_test_interface(
117     const allocator_t* buffer_allocator_interface,
118     const btsnoop_t* btsnoop_interface,
119     const packet_fragmenter_t* packet_fragmenter_interface) {
120   mock_function_count_map[__func__]++;
121   return test::mock::hci_layer::hci_layer_get_test_interface(
122       buffer_allocator_interface, btsnoop_interface,
123       packet_fragmenter_interface);
124 }
125 
126 // END mockcify generation
127