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 extern std::map<std::string, int> mock_function_count_map;
28 
29 // Original included files, if any
30 // NOTE: Since this is a mock file with mock definitions some number of
31 //       include files may not be required.  The include-what-you-use
32 //       still applies, but crafting proper inclusion is out of scope
33 //       for this effort.  This compilation unit may compile as-is, or
34 //       may need attention to prune the inclusion set.
35 
36 // Mock include file to share data between tests and mock
37 #include "test/mock/mock_stack_btm_ble_addr.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   mock_function_count_map[__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   mock_function_count_map[__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   mock_function_count_map[__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   mock_function_count_map[__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   mock_function_count_map[__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   mock_function_count_map[__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,uint8_t * p_addr_type,bool refresh)101 bool btm_identity_addr_to_random_pseudo(RawAddress* bd_addr,
102                                         uint8_t* p_addr_type, bool refresh) {
103   mock_function_count_map[__func__]++;
104   return test::mock::stack_btm_ble_addr::btm_identity_addr_to_random_pseudo(
105       bd_addr, p_addr_type, refresh);
106 }
btm_identity_addr_to_random_pseudo_from_address_with_type(tBLE_BD_ADDR * address_with_type,bool refresh)107 bool btm_identity_addr_to_random_pseudo_from_address_with_type(
108     tBLE_BD_ADDR* address_with_type, bool refresh) {
109   mock_function_count_map[__func__]++;
110   return test::mock::stack_btm_ble_addr::
111       btm_identity_addr_to_random_pseudo_from_address_with_type(
112           address_with_type, refresh);
113 }
btm_random_pseudo_to_identity_addr(RawAddress * random_pseudo,uint8_t * p_identity_addr_type)114 bool btm_random_pseudo_to_identity_addr(RawAddress* random_pseudo,
115                                         uint8_t* p_identity_addr_type) {
116   mock_function_count_map[__func__]++;
117   return test::mock::stack_btm_ble_addr::btm_random_pseudo_to_identity_addr(
118       random_pseudo, p_identity_addr_type);
119 }
btm_ble_refresh_peer_resolvable_private_addr(const RawAddress & pseudo_bda,const RawAddress & rpa,tBTM_SEC_BLE::tADDRESS_TYPE rra_type)120 void btm_ble_refresh_peer_resolvable_private_addr(
121     const RawAddress& pseudo_bda, const RawAddress& rpa,
122     tBTM_SEC_BLE::tADDRESS_TYPE rra_type) {
123   mock_function_count_map[__func__]++;
124   test::mock::stack_btm_ble_addr::btm_ble_refresh_peer_resolvable_private_addr(
125       pseudo_bda, rpa, rra_type);
126 }
127 
128 // END mockcify generation
129