• 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 "test/common/mock_functions.h"
28 
29 // Original usings
30 using bluetooth::Uuid;
31 
32 // Mocked internal structures, if any
33 
34 namespace test {
35 namespace mock {
36 namespace btif_sock_rfc {
37 
38 // Function state capture and return values, if needed
39 struct bta_co_rfc_data_incoming bta_co_rfc_data_incoming;
40 struct bta_co_rfc_data_outgoing bta_co_rfc_data_outgoing;
41 struct bta_co_rfc_data_outgoing_size bta_co_rfc_data_outgoing_size;
42 struct btsock_rfc_cleanup btsock_rfc_cleanup;
43 struct btsock_rfc_connect btsock_rfc_connect;
44 struct btsock_rfc_control_req btsock_rfc_control_req;
45 struct btsock_rfc_disconnect btsock_rfc_disconnect;
46 struct btsock_rfc_init btsock_rfc_init;
47 struct btsock_rfc_listen btsock_rfc_listen;
48 struct btsock_rfc_signaled btsock_rfc_signaled;
49 
50 }  // namespace btif_sock_rfc
51 }  // namespace mock
52 }  // namespace test
53 
54 // Mocked function return values, if any
55 namespace test {
56 namespace mock {
57 namespace btif_sock_rfc {
58 
59 int bta_co_rfc_data_incoming::return_value = 0;
60 int bta_co_rfc_data_outgoing::return_value = 0;
61 int bta_co_rfc_data_outgoing_size::return_value = 0;
62 bt_status_t btsock_rfc_connect::return_value = BT_STATUS_SUCCESS;
63 bt_status_t btsock_rfc_control_req::return_value = BT_STATUS_SUCCESS;
64 bt_status_t btsock_rfc_disconnect::return_value = BT_STATUS_SUCCESS;
65 bt_status_t btsock_rfc_init::return_value = BT_STATUS_SUCCESS;
66 bt_status_t btsock_rfc_listen::return_value = BT_STATUS_SUCCESS;
67 
68 }  // namespace btif_sock_rfc
69 }  // namespace mock
70 }  // namespace test
71 
72 // Mocked functions, if any
bta_co_rfc_data_incoming(uint32_t id,BT_HDR * p_buf)73 int bta_co_rfc_data_incoming(uint32_t id, BT_HDR* p_buf) {
74   inc_func_call_count(__func__);
75   return test::mock::btif_sock_rfc::bta_co_rfc_data_incoming(id, p_buf);
76 }
bta_co_rfc_data_outgoing(uint32_t id,uint8_t * buf,uint16_t size)77 int bta_co_rfc_data_outgoing(uint32_t id, uint8_t* buf, uint16_t size) {
78   inc_func_call_count(__func__);
79   return test::mock::btif_sock_rfc::bta_co_rfc_data_outgoing(id, buf, size);
80 }
bta_co_rfc_data_outgoing_size(uint32_t id,int * size)81 int bta_co_rfc_data_outgoing_size(uint32_t id, int* size) {
82   inc_func_call_count(__func__);
83   return test::mock::btif_sock_rfc::bta_co_rfc_data_outgoing_size(id, size);
84 }
btsock_rfc_cleanup(void)85 void btsock_rfc_cleanup(void) {
86   inc_func_call_count(__func__);
87   test::mock::btif_sock_rfc::btsock_rfc_cleanup();
88 }
btsock_rfc_connect(const RawAddress * bd_addr,const Uuid * service_uuid,int channel,int * sock_fd,int flags,int app_uid)89 bt_status_t btsock_rfc_connect(const RawAddress* bd_addr,
90                                const Uuid* service_uuid, int channel,
91                                int* sock_fd, int flags, int app_uid) {
92   inc_func_call_count(__func__);
93   return test::mock::btif_sock_rfc::btsock_rfc_connect(
94       bd_addr, service_uuid, channel, sock_fd, flags, app_uid);
95 }
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)96 bt_status_t btsock_rfc_control_req(uint8_t dlci, const RawAddress& bd_addr,
97                                    uint8_t modem_signal, uint8_t break_signal,
98                                    uint8_t discard_buffers,
99                                    uint8_t break_signal_seq, bool fc) {
100   inc_func_call_count(__func__);
101   return test::mock::btif_sock_rfc::btsock_rfc_control_req(
102       dlci, bd_addr, modem_signal, break_signal, discard_buffers,
103       break_signal_seq, fc);
104 }
btsock_rfc_disconnect(const RawAddress * bd_addr)105 bt_status_t btsock_rfc_disconnect(const RawAddress* bd_addr) {
106   inc_func_call_count(__func__);
107   return test::mock::btif_sock_rfc::btsock_rfc_disconnect(bd_addr);
108 }
btsock_rfc_init(int poll_thread_handle,uid_set_t * set)109 bt_status_t btsock_rfc_init(int poll_thread_handle, uid_set_t* set) {
110   inc_func_call_count(__func__);
111   return test::mock::btif_sock_rfc::btsock_rfc_init(poll_thread_handle, set);
112 }
btsock_rfc_listen(const char * service_name,const Uuid * service_uuid,int channel,int * sock_fd,int flags,int app_uid)113 bt_status_t btsock_rfc_listen(const char* service_name,
114                               const Uuid* service_uuid, int channel,
115                               int* sock_fd, int flags, int app_uid) {
116   inc_func_call_count(__func__);
117   return test::mock::btif_sock_rfc::btsock_rfc_listen(
118       service_name, service_uuid, channel, sock_fd, flags, app_uid);
119 }
btsock_rfc_signaled(int fd,int flags,uint32_t id)120 void btsock_rfc_signaled(int fd, int flags, uint32_t id) {
121   inc_func_call_count(__func__);
122   test::mock::btif_sock_rfc::btsock_rfc_signaled(fd, flags, id);
123 }
124 // Mocked functions complete
125 // END mockcify generation
126