• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2023 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  * Generated mock file from original source file
18  *   Functions generated:10
19  *
20  *  mockcify.pl ver 0.6.2
21  */
22 // Mock include file to share data between tests and mock
23 #include "test/mock/mock_btif_sock_rfc.h"
24 
25 #include <cstdint>
26 
27 #include "bta/include/bta_jv_co.h"
28 #include "btif/include/btif_sock_rfc.h"
29 #include "test/common/mock_functions.h"
30 
31 // Original usings
32 using bluetooth::Uuid;
33 
34 // Mocked internal structures, if any
35 
36 namespace test {
37 namespace mock {
38 namespace btif_sock_rfc {
39 
40 // Function state capture and return values, if needed
41 struct bta_co_rfc_data_incoming bta_co_rfc_data_incoming;
42 struct bta_co_rfc_data_outgoing bta_co_rfc_data_outgoing;
43 struct bta_co_rfc_data_outgoing_size bta_co_rfc_data_outgoing_size;
44 struct btsock_rfc_cleanup btsock_rfc_cleanup;
45 struct btsock_rfc_connect btsock_rfc_connect;
46 struct btsock_rfc_control_req btsock_rfc_control_req;
47 struct btsock_rfc_disconnect btsock_rfc_disconnect;
48 struct btsock_rfc_init btsock_rfc_init;
49 struct btsock_rfc_listen btsock_rfc_listen;
50 struct btsock_rfc_signaled btsock_rfc_signaled;
51 struct on_btsocket_rfc_close on_btsocket_rfc_close;
52 struct on_btsocket_rfc_opened_complete on_btsocket_rfc_opened_complete;
53 
54 }  // namespace btif_sock_rfc
55 }  // namespace mock
56 }  // namespace test
57 
58 // Mocked function return values, if any
59 namespace test {
60 namespace mock {
61 namespace btif_sock_rfc {
62 
63 int bta_co_rfc_data_incoming::return_value = 0;
64 int bta_co_rfc_data_outgoing::return_value = 0;
65 int bta_co_rfc_data_outgoing_size::return_value = 0;
66 bt_status_t btsock_rfc_connect::return_value = BT_STATUS_SUCCESS;
67 bt_status_t btsock_rfc_control_req::return_value = BT_STATUS_SUCCESS;
68 bt_status_t btsock_rfc_disconnect::return_value = BT_STATUS_SUCCESS;
69 bt_status_t btsock_rfc_init::return_value = BT_STATUS_SUCCESS;
70 bt_status_t btsock_rfc_listen::return_value = BT_STATUS_SUCCESS;
71 
72 }  // namespace btif_sock_rfc
73 }  // namespace mock
74 }  // namespace test
75 
76 // Mocked functions, if any
bta_co_rfc_data_incoming(uint32_t id,BT_HDR * p_buf)77 int bta_co_rfc_data_incoming(uint32_t id, BT_HDR* p_buf) {
78   inc_func_call_count(__func__);
79   return test::mock::btif_sock_rfc::bta_co_rfc_data_incoming(id, p_buf);
80 }
bta_co_rfc_data_outgoing(uint32_t id,uint8_t * buf,uint16_t size)81 int bta_co_rfc_data_outgoing(uint32_t id, uint8_t* buf, uint16_t size) {
82   inc_func_call_count(__func__);
83   return test::mock::btif_sock_rfc::bta_co_rfc_data_outgoing(id, buf, size);
84 }
bta_co_rfc_data_outgoing_size(uint32_t id,int * size)85 int bta_co_rfc_data_outgoing_size(uint32_t id, int* size) {
86   inc_func_call_count(__func__);
87   return test::mock::btif_sock_rfc::bta_co_rfc_data_outgoing_size(id, size);
88 }
btsock_rfc_cleanup(void)89 void btsock_rfc_cleanup(void) {
90   inc_func_call_count(__func__);
91   test::mock::btif_sock_rfc::btsock_rfc_cleanup();
92 }
btsock_rfc_connect(const RawAddress * bd_addr,const bluetooth::Uuid * uuid,int channel,int * sock_fd,int flags,int app_uid,btsock_data_path_t data_path,const char * socket_name,uint64_t hub_id,uint64_t endpoint_id,int max_rx_packet_size)93 bt_status_t btsock_rfc_connect(const RawAddress* bd_addr, const bluetooth::Uuid* uuid, int channel,
94                                int* sock_fd, int flags, int app_uid, btsock_data_path_t data_path,
95                                const char* socket_name, uint64_t hub_id, uint64_t endpoint_id,
96                                int max_rx_packet_size) {
97   inc_func_call_count(__func__);
98   return test::mock::btif_sock_rfc::btsock_rfc_connect(bd_addr, uuid, channel, sock_fd, flags,
99                                                        app_uid, data_path, socket_name, hub_id,
100                                                        endpoint_id, max_rx_packet_size);
101 }
btsock_rfc_control_req(uint8_t dlci,const RawAddress & bd_addr,uint8_t modem_signal,uint8_t break_signal,uint8_t discard_buffers,uint8_t break_signal_seq,bool fc)102 bt_status_t btsock_rfc_control_req(uint8_t dlci, const RawAddress& bd_addr, uint8_t modem_signal,
103                                    uint8_t break_signal, uint8_t discard_buffers,
104                                    uint8_t break_signal_seq, bool fc) {
105   inc_func_call_count(__func__);
106   return test::mock::btif_sock_rfc::btsock_rfc_control_req(
107           dlci, bd_addr, modem_signal, break_signal, discard_buffers, break_signal_seq, fc);
108 }
btsock_rfc_disconnect(const RawAddress * bd_addr)109 bt_status_t btsock_rfc_disconnect(const RawAddress* bd_addr) {
110   inc_func_call_count(__func__);
111   return test::mock::btif_sock_rfc::btsock_rfc_disconnect(bd_addr);
112 }
btsock_rfc_init(int poll_thread_handle,uid_set_t * set)113 bt_status_t btsock_rfc_init(int poll_thread_handle, uid_set_t* set) {
114   inc_func_call_count(__func__);
115   return test::mock::btif_sock_rfc::btsock_rfc_init(poll_thread_handle, set);
116 }
btsock_rfc_listen(const char * service_name,const Uuid * service_uuid,int channel,int * sock_fd,int flags,int app_uid,btsock_data_path_t data_path,const char * socket_name,uint64_t hub_id,uint64_t endpoint_id,int max_rx_packet_size)117 bt_status_t btsock_rfc_listen(const char* service_name, const Uuid* service_uuid, int channel,
118                               int* sock_fd, int flags, int app_uid, btsock_data_path_t data_path,
119                               const char* socket_name, uint64_t hub_id, uint64_t endpoint_id,
120                               int max_rx_packet_size) {
121   inc_func_call_count(__func__);
122   return test::mock::btif_sock_rfc::btsock_rfc_listen(service_name, service_uuid, channel, sock_fd,
123                                                       flags, app_uid, data_path, socket_name,
124                                                       hub_id, endpoint_id, max_rx_packet_size);
125 }
btsock_rfc_signaled(int fd,int flags,uint32_t id)126 void btsock_rfc_signaled(int fd, int flags, uint32_t id) {
127   inc_func_call_count(__func__);
128   test::mock::btif_sock_rfc::btsock_rfc_signaled(fd, flags, id);
129 }
on_btsocket_rfc_close(uint64_t socket_id)130 void on_btsocket_rfc_close(uint64_t socket_id) {
131   inc_func_call_count(__func__);
132   test::mock::btif_sock_rfc::on_btsocket_rfc_close(socket_id);
133 }
on_btsocket_rfc_opened_complete(uint64_t socket_id,bool success)134 void on_btsocket_rfc_opened_complete(uint64_t socket_id, bool success) {
135   inc_func_call_count(__func__);
136   test::mock::btif_sock_rfc::on_btsocket_rfc_opened_complete(socket_id, success);
137 }
138 // Mocked functions complete
139 // END mockcify generation
140