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,
57 tPAN_ROLE dst_role, uint16_t* handle) {
58 inc_func_call_count(__func__);
59 return test::mock::stack_pan_api::PAN_Connect(rem_bda, src_role, dst_role,
60 handle);
61 }
PAN_Disconnect(uint16_t handle)62 tPAN_RESULT PAN_Disconnect(uint16_t handle) {
63 inc_func_call_count(__func__);
64 return test::mock::stack_pan_api::PAN_Disconnect(handle);
65 }
PAN_SetMulticastFilters(uint16_t handle,uint16_t num_mcast_filters,uint8_t * p_start_array,uint8_t * p_end_array)66 tPAN_RESULT PAN_SetMulticastFilters(uint16_t handle, uint16_t num_mcast_filters,
67 uint8_t* p_start_array,
68 uint8_t* p_end_array) {
69 inc_func_call_count(__func__);
70 return test::mock::stack_pan_api::PAN_SetMulticastFilters(
71 handle, num_mcast_filters, p_start_array, p_end_array);
72 }
PAN_SetProtocolFilters(uint16_t handle,uint16_t num_filters,uint16_t * p_start_array,uint16_t * p_end_array)73 tPAN_RESULT PAN_SetProtocolFilters(uint16_t handle, uint16_t num_filters,
74 uint16_t* p_start_array,
75 uint16_t* p_end_array) {
76 inc_func_call_count(__func__);
77 return test::mock::stack_pan_api::PAN_SetProtocolFilters(
78 handle, num_filters, p_start_array, p_end_array);
79 }
PAN_SetRole(uint8_t role,std::string p_user_name,std::string p_nap_name)80 tPAN_RESULT PAN_SetRole(uint8_t role, std::string p_user_name,
81 std::string p_nap_name) {
82 inc_func_call_count(__func__);
83 return test::mock::stack_pan_api::PAN_SetRole(role, p_user_name, p_nap_name);
84 }
PAN_Write(uint16_t handle,const RawAddress & dst,const RawAddress & src,uint16_t protocol,uint8_t * p_data,uint16_t len,bool ext)85 tPAN_RESULT PAN_Write(uint16_t handle, const RawAddress& dst,
86 const RawAddress& src, uint16_t protocol, uint8_t* p_data,
87 uint16_t len, bool ext) {
88 inc_func_call_count(__func__);
89 return test::mock::stack_pan_api::PAN_Write(handle, dst, src, protocol,
90 p_data, len, ext);
91 }
PAN_WriteBuf(uint16_t handle,const RawAddress & dst,const RawAddress & src,uint16_t protocol,BT_HDR * p_buf,bool ext)92 tPAN_RESULT PAN_WriteBuf(uint16_t handle, const RawAddress& dst,
93 const RawAddress& src, uint16_t protocol,
94 BT_HDR* p_buf, bool ext) {
95 inc_func_call_count(__func__);
96 return test::mock::stack_pan_api::PAN_WriteBuf(handle, dst, src, protocol,
97 p_buf, ext);
98 }
PAN_Deregister(void)99 void PAN_Deregister(void) {
100 inc_func_call_count(__func__);
101 test::mock::stack_pan_api::PAN_Deregister();
102 }
PAN_Dumpsys(int fd)103 void PAN_Dumpsys(int fd) {
104 inc_func_call_count(__func__);
105 test::mock::stack_pan_api::PAN_Dumpsys(fd);
106 }
PAN_Init(void)107 void PAN_Init(void) {
108 inc_func_call_count(__func__);
109 test::mock::stack_pan_api::PAN_Init();
110 }
PAN_Register(tPAN_REGISTER * p_register)111 void PAN_Register(tPAN_REGISTER* p_register) {
112 inc_func_call_count(__func__);
113 test::mock::stack_pan_api::PAN_Register(p_register);
114 }
115
116 // END mockcify generation
117