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:11
20 *
21 * mockcify.pl ver 0.2
22 */
23
24 #include <cstdint>
25 #include <functional>
26 #include <map>
27 #include <string>
28
29 // Mock include file to share data between tests and mock
30 #include "test/mock/mock_stack_btm_ble_bgconn.h"
31 #include "types/raw_address.h"
32
33 // Mocked compile conditionals, if any
34 #ifndef UNUSED_ATTR
35 #define UNUSED_ATTR
36 #endif
37
38 // Mocked internal structures, if any
39 struct BackgroundConnection {};
40 struct BgConnHash {};
41
42 namespace test {
43 namespace mock {
44 namespace stack_btm_ble_bgconn {
45
46 // Function state capture and return values, if needed
47 struct convert_to_address_with_type convert_to_address_with_type;
48 struct btm_update_scanner_filter_policy btm_update_scanner_filter_policy;
49 struct btm_ble_suspend_bg_conn btm_ble_suspend_bg_conn;
50 struct btm_ble_resume_bg_conn btm_ble_resume_bg_conn;
51 struct BTM_BackgroundConnectAddressKnown BTM_BackgroundConnectAddressKnown;
52 struct BTM_SetLeConnectionModeToFast BTM_SetLeConnectionModeToFast;
53 struct BTM_SetLeConnectionModeToSlow BTM_SetLeConnectionModeToSlow;
54 struct BTM_AcceptlistAdd BTM_AcceptlistAdd;
55 struct BTM_AcceptlistAddDirect BTM_AcceptlistAddDirect;
56 struct BTM_AcceptlistRemove BTM_AcceptlistRemove;
57 struct BTM_AcceptlistClear BTM_AcceptlistClear;
58
59 } // namespace stack_btm_ble_bgconn
60 } // namespace mock
61 } // namespace test
62
63 // Mocked functions, if any
convert_to_address_with_type(const RawAddress & bd_addr,const tBTM_SEC_DEV_REC * p_dev_rec)64 const tBLE_BD_ADDR convert_to_address_with_type(
65 const RawAddress& bd_addr, const tBTM_SEC_DEV_REC* p_dev_rec) {
66 inc_func_call_count(__func__);
67 return test::mock::stack_btm_ble_bgconn::convert_to_address_with_type(
68 bd_addr, p_dev_rec);
69 }
btm_update_scanner_filter_policy(tBTM_BLE_SFP scan_policy)70 void btm_update_scanner_filter_policy(tBTM_BLE_SFP scan_policy) {
71 inc_func_call_count(__func__);
72 test::mock::stack_btm_ble_bgconn::btm_update_scanner_filter_policy(
73 scan_policy);
74 }
btm_ble_suspend_bg_conn(void)75 bool btm_ble_suspend_bg_conn(void) {
76 inc_func_call_count(__func__);
77 return test::mock::stack_btm_ble_bgconn::btm_ble_suspend_bg_conn();
78 }
btm_ble_resume_bg_conn(void)79 bool btm_ble_resume_bg_conn(void) {
80 inc_func_call_count(__func__);
81 return test::mock::stack_btm_ble_bgconn::btm_ble_resume_bg_conn();
82 }
BTM_BackgroundConnectAddressKnown(const RawAddress & address)83 bool BTM_BackgroundConnectAddressKnown(const RawAddress& address) {
84 inc_func_call_count(__func__);
85 return test::mock::stack_btm_ble_bgconn::BTM_BackgroundConnectAddressKnown(
86 address);
87 }
BTM_SetLeConnectionModeToFast()88 bool BTM_SetLeConnectionModeToFast() {
89 inc_func_call_count(__func__);
90 return test::mock::stack_btm_ble_bgconn::BTM_SetLeConnectionModeToFast();
91 }
BTM_SetLeConnectionModeToSlow()92 void BTM_SetLeConnectionModeToSlow() {
93 inc_func_call_count(__func__);
94 test::mock::stack_btm_ble_bgconn::BTM_SetLeConnectionModeToSlow();
95 }
BTM_AcceptlistAdd(const RawAddress & address)96 bool BTM_AcceptlistAdd(const RawAddress& address) {
97 inc_func_call_count(__func__);
98 return test::mock::stack_btm_ble_bgconn::BTM_AcceptlistAdd(address);
99 }
BTM_AcceptlistAdd(const RawAddress & address,bool is_direct)100 bool BTM_AcceptlistAdd(const RawAddress& address, bool is_direct) {
101 inc_func_call_count(__func__);
102 return test::mock::stack_btm_ble_bgconn::BTM_AcceptlistAddDirect(address,
103 is_direct);
104 }
BTM_AcceptlistRemove(const RawAddress & address)105 void BTM_AcceptlistRemove(const RawAddress& address) {
106 inc_func_call_count(__func__);
107 test::mock::stack_btm_ble_bgconn::BTM_AcceptlistRemove(address);
108 }
BTM_AcceptlistClear()109 void BTM_AcceptlistClear() {
110 inc_func_call_count(__func__);
111 test::mock::stack_btm_ble_bgconn::BTM_AcceptlistClear();
112 }
113
114 // END mockcify generation
115