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
22 #include <cstdint>
23
24 #include "test/common/mock_functions.h"
25 #include "udrv/include/uipc.h"
26
27 // TODO(b/369381361) Enfore -Wmissing-prototypes
28 #pragma GCC diagnostic ignored "-Wmissing-prototypes"
29
30 std::unique_ptr<tUIPC_STATE> mock_uipc_init_ret;
31 uint32_t mock_uipc_read_ret;
32 bool mock_uipc_send_ret;
33
UIPC_Open(tUIPC_STATE &,tUIPC_CH_ID,tUIPC_RCV_CBACK *,const char *)34 bool UIPC_Open(tUIPC_STATE& /* uipc */, tUIPC_CH_ID /* ch_id */, tUIPC_RCV_CBACK* /* p_cback */,
35 const char* /* socket_path */) {
36 inc_func_call_count(__func__);
37 return false;
38 }
UIPC_Send(tUIPC_STATE &,tUIPC_CH_ID,uint16_t,const uint8_t *,uint16_t)39 bool UIPC_Send(tUIPC_STATE& /* uipc */, tUIPC_CH_ID /* ch_id */, uint16_t /* msg_evt */,
40 const uint8_t* /* p_buf */, uint16_t /* msglen */) {
41 inc_func_call_count(__func__);
42 return mock_uipc_send_ret;
43 }
uipc_start_main_server_thread(tUIPC_STATE &)44 int uipc_start_main_server_thread(tUIPC_STATE& /* uipc */) {
45 inc_func_call_count(__func__);
46 return 0;
47 }
UIPC_Init()48 std::unique_ptr<tUIPC_STATE> UIPC_Init() {
49 inc_func_call_count(__func__);
50 return std::move(mock_uipc_init_ret);
51 }
dump_uipc_event(tUIPC_EVENT)52 const char* dump_uipc_event(tUIPC_EVENT /* event */) {
53 inc_func_call_count(__func__);
54 return nullptr;
55 }
UIPC_Read(tUIPC_STATE &,tUIPC_CH_ID,uint8_t *,uint32_t)56 uint32_t UIPC_Read(tUIPC_STATE& /* uipc */, tUIPC_CH_ID /* ch_id */, uint8_t* /* p_buf */,
57 uint32_t /* len */) {
58 inc_func_call_count(__func__);
59 return mock_uipc_read_ret;
60 }
UIPC_Ioctl(tUIPC_STATE &,tUIPC_CH_ID,uint32_t,void *)61 bool UIPC_Ioctl(tUIPC_STATE& /* uipc */, tUIPC_CH_ID /* ch_id */, uint32_t /* request */,
62 void* /* param */) {
63 inc_func_call_count(__func__);
64 return false;
65 }
UIPC_Close(tUIPC_STATE &,tUIPC_CH_ID)66 void UIPC_Close(tUIPC_STATE& /* uipc */, tUIPC_CH_ID /* ch_id */) { inc_func_call_count(__func__); }
uipc_close_locked(tUIPC_STATE &,tUIPC_CH_ID)67 void uipc_close_locked(tUIPC_STATE& /* uipc */, tUIPC_CH_ID /* ch_id */) {
68 inc_func_call_count(__func__);
69 }
uipc_main_cleanup(tUIPC_STATE &)70 void uipc_main_cleanup(tUIPC_STATE& /* uipc */) { inc_func_call_count(__func__); }
uipc_stop_main_server_thread(tUIPC_STATE &)71 void uipc_stop_main_server_thread(tUIPC_STATE& /* uipc */) { inc_func_call_count(__func__); }
72