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_client_interface.h"
32 #include "test/common/mock_functions.h"
33 #include "types/raw_address.h"
34
35 // TODO(b/369381361) Enfore -Wmissing-prototypes
36 #pragma GCC diagnostic ignored "-Wmissing-prototypes"
37
38 namespace test {
39 namespace mock {
40 namespace stack_btm_dev {
41
42 struct btm_find_dev btm_find_dev;
43 struct BTM_Sec_AddressKnown BTM_Sec_AddressKnown;
44
45 struct maybe_resolve_address maybe_resolve_address;
46 } // namespace stack_btm_dev
47 } // namespace mock
48 } // namespace test
49
BTM_SecAddDevice(const RawAddress &,const DEV_CLASS,LinkKey,uint8_t,uint8_t)50 void BTM_SecAddDevice(const RawAddress& /* bd_addr */, const DEV_CLASS /* dev_class */,
51 LinkKey /* link_key */, uint8_t /* key_type */, uint8_t /* pin_length */) {
52 inc_func_call_count(__func__);
53 }
BTM_SecDeleteDevice(const RawAddress &)54 bool BTM_SecDeleteDevice(const RawAddress& /* bd_addr */) {
55 inc_func_call_count(__func__);
56 return false;
57 }
btm_set_bond_type_dev(const RawAddress &,tBTM_BOND_TYPE)58 bool btm_set_bond_type_dev(const RawAddress& /* bd_addr */, tBTM_BOND_TYPE /* bond_type */) {
59 inc_func_call_count(__func__);
60 return false;
61 }
BTM_SecReadDevName(const RawAddress &)62 const char* BTM_SecReadDevName(const RawAddress& /* bd_addr */) {
63 inc_func_call_count(__func__);
64 return nullptr;
65 }
BTM_SecReadDevClass(const RawAddress &)66 DEV_CLASS BTM_SecReadDevClass(const RawAddress& /* bd_addr */) {
67 inc_func_call_count(__func__);
68 return kDevClassEmpty;
69 }
btm_find_dev(const RawAddress & bd_addr)70 tBTM_SEC_DEV_REC* btm_find_dev(const RawAddress& bd_addr) {
71 inc_func_call_count(__func__);
72 return test::mock::stack_btm_dev::btm_find_dev.body(bd_addr);
73 }
btm_find_dev_by_handle(uint16_t)74 tBTM_SEC_DEV_REC* btm_find_dev_by_handle(uint16_t /* handle */) {
75 inc_func_call_count(__func__);
76 return nullptr;
77 }
btm_find_or_alloc_dev(const RawAddress &)78 tBTM_SEC_DEV_REC* btm_find_or_alloc_dev(const RawAddress& /* bd_addr */) {
79 inc_func_call_count(__func__);
80 return nullptr;
81 }
btm_sec_alloc_dev(const RawAddress &)82 tBTM_SEC_DEV_REC* btm_sec_alloc_dev(const RawAddress& /* bd_addr */) {
83 inc_func_call_count(__func__);
84 return nullptr;
85 }
btm_sec_allocate_dev_rec(void)86 tBTM_SEC_DEV_REC* btm_sec_allocate_dev_rec(void) {
87 inc_func_call_count(__func__);
88 return nullptr;
89 }
btm_get_bond_type_dev(const RawAddress &)90 tBTM_BOND_TYPE btm_get_bond_type_dev(const RawAddress& /* bd_addr */) {
91 inc_func_call_count(__func__);
92 return BOND_TYPE_UNKNOWN;
93 }
BTM_SecClearSecurityFlags(const RawAddress &)94 void BTM_SecClearSecurityFlags(const RawAddress& /* bd_addr */) { inc_func_call_count(__func__); }
btm_consolidate_dev(tBTM_SEC_DEV_REC *)95 void btm_consolidate_dev(tBTM_SEC_DEV_REC* /* p_target_rec */) { inc_func_call_count(__func__); }
btm_dev_consolidate_existing_connections(const RawAddress &)96 void btm_dev_consolidate_existing_connections(const RawAddress& /* bd_addr */) {
97 inc_func_call_count(__func__);
98 }
BTM_SecDump(const std::string &)99 void BTM_SecDump(const std::string& /* label */) { inc_func_call_count(__func__); }
BTM_SecDumpDev(const RawAddress &)100 void BTM_SecDumpDev(const RawAddress& /* bd_addr */) { inc_func_call_count(__func__); }
btm_get_sec_dev_rec()101 std::vector<tBTM_SEC_DEV_REC*> btm_get_sec_dev_rec() {
102 inc_func_call_count(__func__);
103 return {};
104 }
BTM_Sec_AddressKnown(const RawAddress & address)105 bool BTM_Sec_AddressKnown(const RawAddress& address) {
106 inc_func_call_count(__func__);
107 return test::mock::stack_btm_dev::BTM_Sec_AddressKnown(address);
108 }
109
maybe_resolve_address(RawAddress * bda,tBLE_ADDR_TYPE * bda_type)110 bool maybe_resolve_address(RawAddress* bda, tBLE_ADDR_TYPE* bda_type) {
111 inc_func_call_count(__func__);
112 return test::mock::stack_btm_dev::maybe_resolve_address(bda, bda_type);
113 }
BTM_Sec_GetAddressWithType(const RawAddress &)114 const tBLE_BD_ADDR BTM_Sec_GetAddressWithType(const RawAddress& /* bd_addr */) {
115 inc_func_call_count(__func__);
116 return {};
117 }
118
DumpsysRecord(int)119 void DumpsysRecord(int /* fd */) { inc_func_call_count(__func__); }
120