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