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:12
20  *
21  *  mockcify.pl ver 0.2.1
22  */
23 // Mock include file to share data between tests and mock
24 #include "test/mock/mock_stack_pan_api.h"
25 
26 #include <cstdint>
27 #include <string>
28 
29 #include "test/common/mock_functions.h"
30 
31 // Mocked compile conditionals, if any
32 // Mocked internal structures, if any
33 
34 namespace test {
35 namespace mock {
36 namespace stack_pan_api {
37 
38 // Function state capture and return values, if needed
39 struct PAN_Connect PAN_Connect;
40 struct PAN_Disconnect PAN_Disconnect;
41 struct PAN_SetMulticastFilters PAN_SetMulticastFilters;
42 struct PAN_SetProtocolFilters PAN_SetProtocolFilters;
43 struct PAN_SetRole PAN_SetRole;
44 struct PAN_Write PAN_Write;
45 struct PAN_WriteBuf PAN_WriteBuf;
46 struct PAN_Deregister PAN_Deregister;
47 struct PAN_Dumpsys PAN_Dumpsys;
48 struct PAN_Init PAN_Init;
49 struct PAN_Register PAN_Register;
50 
51 }  // namespace stack_pan_api
52 }  // namespace mock
53 }  // namespace test
54 
55 // Mocked functions, if any
PAN_Connect(const RawAddress & rem_bda,tPAN_ROLE src_role,tPAN_ROLE dst_role,uint16_t * handle)56 tPAN_RESULT PAN_Connect(const RawAddress& rem_bda, tPAN_ROLE src_role, tPAN_ROLE dst_role,
57                         uint16_t* handle) {
58   inc_func_call_count(__func__);
59   return test::mock::stack_pan_api::PAN_Connect(rem_bda, src_role, dst_role, handle);
60 }
PAN_Disconnect(uint16_t handle)61 tPAN_RESULT PAN_Disconnect(uint16_t handle) {
62   inc_func_call_count(__func__);
63   return test::mock::stack_pan_api::PAN_Disconnect(handle);
64 }
PAN_SetMulticastFilters(uint16_t handle,uint16_t num_mcast_filters,uint8_t * p_start_array,uint8_t * p_end_array)65 tPAN_RESULT PAN_SetMulticastFilters(uint16_t handle, uint16_t num_mcast_filters,
66                                     uint8_t* p_start_array, uint8_t* p_end_array) {
67   inc_func_call_count(__func__);
68   return test::mock::stack_pan_api::PAN_SetMulticastFilters(handle, num_mcast_filters,
69                                                             p_start_array, p_end_array);
70 }
PAN_SetProtocolFilters(uint16_t handle,uint16_t num_filters,uint16_t * p_start_array,uint16_t * p_end_array)71 tPAN_RESULT PAN_SetProtocolFilters(uint16_t handle, uint16_t num_filters, uint16_t* p_start_array,
72                                    uint16_t* p_end_array) {
73   inc_func_call_count(__func__);
74   return test::mock::stack_pan_api::PAN_SetProtocolFilters(handle, num_filters, p_start_array,
75                                                            p_end_array);
76 }
PAN_SetRole(uint8_t role,std::string p_user_name,std::string p_nap_name)77 tPAN_RESULT PAN_SetRole(uint8_t role, std::string p_user_name, std::string p_nap_name) {
78   inc_func_call_count(__func__);
79   return test::mock::stack_pan_api::PAN_SetRole(role, p_user_name, p_nap_name);
80 }
PAN_Write(uint16_t handle,const RawAddress & dst,const RawAddress & src,uint16_t protocol,uint8_t * p_data,uint16_t len,bool ext)81 tPAN_RESULT PAN_Write(uint16_t handle, const RawAddress& dst, const RawAddress& src,
82                       uint16_t protocol, uint8_t* p_data, uint16_t len, bool ext) {
83   inc_func_call_count(__func__);
84   return test::mock::stack_pan_api::PAN_Write(handle, dst, src, protocol, p_data, len, ext);
85 }
PAN_WriteBuf(uint16_t handle,const RawAddress & dst,const RawAddress & src,uint16_t protocol,BT_HDR * p_buf,bool ext)86 tPAN_RESULT PAN_WriteBuf(uint16_t handle, const RawAddress& dst, const RawAddress& src,
87                          uint16_t protocol, BT_HDR* p_buf, bool ext) {
88   inc_func_call_count(__func__);
89   return test::mock::stack_pan_api::PAN_WriteBuf(handle, dst, src, protocol, p_buf, ext);
90 }
PAN_Deregister(void)91 void PAN_Deregister(void) {
92   inc_func_call_count(__func__);
93   test::mock::stack_pan_api::PAN_Deregister();
94 }
PAN_Dumpsys(int fd)95 void PAN_Dumpsys(int fd) {
96   inc_func_call_count(__func__);
97   test::mock::stack_pan_api::PAN_Dumpsys(fd);
98 }
PAN_Init(void)99 void PAN_Init(void) {
100   inc_func_call_count(__func__);
101   test::mock::stack_pan_api::PAN_Init();
102 }
PAN_Register(tPAN_REGISTER * p_register)103 void PAN_Register(tPAN_REGISTER* p_register) {
104   inc_func_call_count(__func__);
105   test::mock::stack_pan_api::PAN_Register(p_register);
106 }
107 
108 // END mockcify generation
109