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:16
20 */
21
22 #include "test/mock/mock_stack_btm_dev.h"
23
24 #include <stddef.h>
25 #include <stdlib.h>
26
27 #include <string>
28
29 #include "stack/btm/btm_dev.h"
30 #include "stack/include/bt_octets.h"
31 #include "stack/include/btm_api.h"
32 #include "test/common/mock_functions.h"
33 #include "types/raw_address.h"
34
35 namespace test {
36 namespace mock {
37 namespace stack_btm_dev {
38
39 struct btm_find_dev btm_find_dev;
40 struct BTM_Sec_AddressKnown BTM_Sec_AddressKnown;
41
42 struct maybe_resolve_address maybe_resolve_address;
43 }
44 } // namespace mock
45 } // namespace test
46
BTM_SecAddDevice(const RawAddress &,const DEV_CLASS,LinkKey,uint8_t,uint8_t)47 void BTM_SecAddDevice(const RawAddress& /* bd_addr */,
48 const DEV_CLASS /* dev_class */, LinkKey /* link_key */,
49 uint8_t /* key_type */, uint8_t /* pin_length */) {
50 inc_func_call_count(__func__);
51 }
BTM_SecDeleteDevice(const RawAddress &)52 bool BTM_SecDeleteDevice(const RawAddress& /* bd_addr */) {
53 inc_func_call_count(__func__);
54 return false;
55 }
btm_set_bond_type_dev(const RawAddress &,tBTM_BOND_TYPE)56 bool btm_set_bond_type_dev(const RawAddress& /* bd_addr */,
57 tBTM_BOND_TYPE /* bond_type */) {
58 inc_func_call_count(__func__);
59 return false;
60 }
BTM_SecReadDevName(const RawAddress &)61 const char* BTM_SecReadDevName(const RawAddress& /* bd_addr */) {
62 inc_func_call_count(__func__);
63 return nullptr;
64 }
btm_find_dev(const RawAddress & bd_addr)65 tBTM_SEC_DEV_REC* btm_find_dev(const RawAddress& bd_addr) {
66 inc_func_call_count(__func__);
67 return test::mock::stack_btm_dev::btm_find_dev.body(bd_addr);
68 }
btm_find_dev_by_handle(uint16_t)69 tBTM_SEC_DEV_REC* btm_find_dev_by_handle(uint16_t /* handle */) {
70 inc_func_call_count(__func__);
71 return nullptr;
72 }
btm_find_or_alloc_dev(const RawAddress &)73 tBTM_SEC_DEV_REC* btm_find_or_alloc_dev(const RawAddress& /* bd_addr */) {
74 inc_func_call_count(__func__);
75 return nullptr;
76 }
btm_sec_alloc_dev(const RawAddress &)77 tBTM_SEC_DEV_REC* btm_sec_alloc_dev(const RawAddress& /* bd_addr */) {
78 inc_func_call_count(__func__);
79 return nullptr;
80 }
btm_sec_allocate_dev_rec(void)81 tBTM_SEC_DEV_REC* btm_sec_allocate_dev_rec(void) {
82 inc_func_call_count(__func__);
83 return nullptr;
84 }
btm_get_bond_type_dev(const RawAddress &)85 tBTM_BOND_TYPE btm_get_bond_type_dev(const RawAddress& /* bd_addr */) {
86 inc_func_call_count(__func__);
87 return BOND_TYPE_UNKNOWN;
88 }
BTM_SecClearSecurityFlags(const RawAddress &)89 void BTM_SecClearSecurityFlags(const RawAddress& /* bd_addr */) {
90 inc_func_call_count(__func__);
91 }
btm_consolidate_dev(tBTM_SEC_DEV_REC *)92 void btm_consolidate_dev(tBTM_SEC_DEV_REC* /* p_target_rec */) {
93 inc_func_call_count(__func__);
94 }
btm_dev_consolidate_existing_connections(const RawAddress &)95 void btm_dev_consolidate_existing_connections(const RawAddress& /* bd_addr */) {
96 inc_func_call_count(__func__);
97 }
BTM_SecDump(const std::string &)98 void BTM_SecDump(const std::string& /* label */) {
99 inc_func_call_count(__func__);
100 }
BTM_SecDumpDev(const RawAddress &)101 void BTM_SecDumpDev(const RawAddress& /* bd_addr */) {
102 inc_func_call_count(__func__);
103 }
btm_get_sec_dev_rec()104 std::vector<tBTM_SEC_DEV_REC*> btm_get_sec_dev_rec() {
105 inc_func_call_count(__func__);
106 return {};
107 }
108
BTM_SetConsolidationCallback(BTM_CONSOLIDATION_CB *)109 void BTM_SetConsolidationCallback(BTM_CONSOLIDATION_CB* /* cb */) {
110 inc_func_call_count(__func__);
111 }
112
BTM_Sec_AddressKnown(const RawAddress & address)113 bool BTM_Sec_AddressKnown(const RawAddress& address) {
114 inc_func_call_count(__func__);
115 return test::mock::stack_btm_dev::BTM_Sec_AddressKnown(address);
116 }
117
maybe_resolve_address(RawAddress * bda,tBLE_ADDR_TYPE * bda_type)118 bool maybe_resolve_address(RawAddress* bda, tBLE_ADDR_TYPE* bda_type) {
119 inc_func_call_count(__func__);
120 return test::mock::stack_btm_dev::maybe_resolve_address(bda, bda_type);
121 }
BTM_Sec_GetAddressWithType(const RawAddress &)122 const tBLE_BD_ADDR BTM_Sec_GetAddressWithType(const RawAddress& /* bd_addr */) {
123 return {};
124 }
125