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:10
20 *
21 * mockcify.pl ver 0.2
22 */
23
24 #include <map>
25 #include <string>
26
27 // Original included files, if any
28 // NOTE: Since this is a mock file with mock definitions some number of
29 // include files may not be required. The include-what-you-use
30 // still applies, but crafting proper inclusion is out of scope
31 // for this effort. This compilation unit may compile as-is, or
32 // may need attention to prune the inclusion set.
33
34 // Mock include file to share data between tests and mock
35 #include "test/mock/mock_stack_btm_ble_addr.h"
36 #include "types/ble_address_with_type.h"
37 #include "types/raw_address.h"
38
39 // Mocked compile conditionals, if any
40 #ifndef UNUSED_ATTR
41 #define UNUSED_ATTR
42 #endif
43
44 // Mocked internal structures, if any
45
46 namespace test {
47 namespace mock {
48 namespace stack_btm_ble_addr {
49
50 // Function state capture and return values, if needed
51 struct btm_gen_resolve_paddr_low btm_gen_resolve_paddr_low;
52 struct btm_gen_resolvable_private_addr btm_gen_resolvable_private_addr;
53 struct btm_get_next_private_addrress_interval_ms
54 btm_get_next_private_addrress_interval_ms;
55 struct btm_ble_init_pseudo_addr btm_ble_init_pseudo_addr;
56 struct btm_ble_addr_resolvable btm_ble_addr_resolvable;
57 struct btm_ble_resolve_random_addr btm_ble_resolve_random_addr;
58 struct btm_identity_addr_to_random_pseudo btm_identity_addr_to_random_pseudo;
59 struct btm_identity_addr_to_random_pseudo_from_address_with_type
60 btm_identity_addr_to_random_pseudo_from_address_with_type;
61 struct btm_random_pseudo_to_identity_addr btm_random_pseudo_to_identity_addr;
62 struct btm_ble_refresh_peer_resolvable_private_addr
63 btm_ble_refresh_peer_resolvable_private_addr;
64
65 } // namespace stack_btm_ble_addr
66 } // namespace mock
67 } // namespace test
68
69 // Mocked functions, if any
btm_gen_resolve_paddr_low(const RawAddress & address)70 void btm_gen_resolve_paddr_low(const RawAddress& address) {
71 inc_func_call_count(__func__);
72 test::mock::stack_btm_ble_addr::btm_gen_resolve_paddr_low(address);
73 }
btm_gen_resolvable_private_addr(base::Callback<void (const RawAddress &)> cb)74 void btm_gen_resolvable_private_addr(
75 base::Callback<void(const RawAddress&)> cb) {
76 inc_func_call_count(__func__);
77 test::mock::stack_btm_ble_addr::btm_gen_resolvable_private_addr(cb);
78 }
btm_get_next_private_addrress_interval_ms()79 uint64_t btm_get_next_private_addrress_interval_ms() {
80 inc_func_call_count(__func__);
81 return test::mock::stack_btm_ble_addr::
82 btm_get_next_private_addrress_interval_ms();
83 }
btm_ble_init_pseudo_addr(tBTM_SEC_DEV_REC * p_dev_rec,const RawAddress & new_pseudo_addr)84 bool btm_ble_init_pseudo_addr(tBTM_SEC_DEV_REC* p_dev_rec,
85 const RawAddress& new_pseudo_addr) {
86 inc_func_call_count(__func__);
87 return test::mock::stack_btm_ble_addr::btm_ble_init_pseudo_addr(
88 p_dev_rec, new_pseudo_addr);
89 }
btm_ble_addr_resolvable(const RawAddress & rpa,tBTM_SEC_DEV_REC * p_dev_rec)90 bool btm_ble_addr_resolvable(const RawAddress& rpa,
91 tBTM_SEC_DEV_REC* p_dev_rec) {
92 inc_func_call_count(__func__);
93 return test::mock::stack_btm_ble_addr::btm_ble_addr_resolvable(rpa,
94 p_dev_rec);
95 }
btm_ble_resolve_random_addr(const RawAddress & random_bda)96 tBTM_SEC_DEV_REC* btm_ble_resolve_random_addr(const RawAddress& random_bda) {
97 inc_func_call_count(__func__);
98 return test::mock::stack_btm_ble_addr::btm_ble_resolve_random_addr(
99 random_bda);
100 }
btm_identity_addr_to_random_pseudo(RawAddress * bd_addr,tBLE_ADDR_TYPE * p_addr_type,bool refresh)101 bool btm_identity_addr_to_random_pseudo(RawAddress* bd_addr,
102 tBLE_ADDR_TYPE* p_addr_type,
103 bool refresh) {
104 inc_func_call_count(__func__);
105 return test::mock::stack_btm_ble_addr::btm_identity_addr_to_random_pseudo(
106 bd_addr, p_addr_type, refresh);
107 }
btm_identity_addr_to_random_pseudo_from_address_with_type(tBLE_BD_ADDR * address_with_type,bool refresh)108 bool btm_identity_addr_to_random_pseudo_from_address_with_type(
109 tBLE_BD_ADDR* address_with_type, bool refresh) {
110 inc_func_call_count(__func__);
111 return test::mock::stack_btm_ble_addr::
112 btm_identity_addr_to_random_pseudo_from_address_with_type(
113 address_with_type, refresh);
114 }
btm_random_pseudo_to_identity_addr(RawAddress * random_pseudo,tBLE_ADDR_TYPE * p_identity_addr_type)115 bool btm_random_pseudo_to_identity_addr(RawAddress* random_pseudo,
116 tBLE_ADDR_TYPE* p_identity_addr_type) {
117 inc_func_call_count(__func__);
118 return test::mock::stack_btm_ble_addr::btm_random_pseudo_to_identity_addr(
119 random_pseudo, p_identity_addr_type);
120 }
btm_ble_refresh_peer_resolvable_private_addr(const RawAddress & pseudo_bda,const RawAddress & rpa,tBTM_SEC_BLE::tADDRESS_TYPE rra_type)121 void btm_ble_refresh_peer_resolvable_private_addr(
122 const RawAddress& pseudo_bda, const RawAddress& rpa,
123 tBTM_SEC_BLE::tADDRESS_TYPE rra_type) {
124 inc_func_call_count(__func__);
125 test::mock::stack_btm_ble_addr::btm_ble_refresh_peer_resolvable_private_addr(
126 pseudo_bda, rpa, rra_type);
127 }
128
129 // END mockcify generation
130