• 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: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 #include "types/ble_address_with_type.h"
39 #include "types/raw_address.h"
40 
41 // Mocked compile conditionals, if any
42 #ifndef UNUSED_ATTR
43 #define UNUSED_ATTR
44 #endif
45 
46 // Mocked internal structures, if any
47 
48 namespace test {
49 namespace mock {
50 namespace stack_btm_ble_addr {
51 
52 // Function state capture and return values, if needed
53 struct btm_gen_resolve_paddr_low btm_gen_resolve_paddr_low;
54 struct btm_gen_resolvable_private_addr btm_gen_resolvable_private_addr;
55 struct btm_get_next_private_addrress_interval_ms
56     btm_get_next_private_addrress_interval_ms;
57 struct btm_ble_init_pseudo_addr btm_ble_init_pseudo_addr;
58 struct btm_ble_addr_resolvable btm_ble_addr_resolvable;
59 struct btm_ble_resolve_random_addr btm_ble_resolve_random_addr;
60 struct btm_identity_addr_to_random_pseudo btm_identity_addr_to_random_pseudo;
61 struct btm_identity_addr_to_random_pseudo_from_address_with_type
62     btm_identity_addr_to_random_pseudo_from_address_with_type;
63 struct btm_random_pseudo_to_identity_addr btm_random_pseudo_to_identity_addr;
64 struct btm_ble_refresh_peer_resolvable_private_addr
65     btm_ble_refresh_peer_resolvable_private_addr;
66 
67 }  // namespace stack_btm_ble_addr
68 }  // namespace mock
69 }  // namespace test
70 
71 // Mocked functions, if any
btm_gen_resolve_paddr_low(const RawAddress & address)72 void btm_gen_resolve_paddr_low(const RawAddress& address) {
73   mock_function_count_map[__func__]++;
74   test::mock::stack_btm_ble_addr::btm_gen_resolve_paddr_low(address);
75 }
btm_gen_resolvable_private_addr(base::Callback<void (const RawAddress &)> cb)76 void btm_gen_resolvable_private_addr(
77     base::Callback<void(const RawAddress&)> cb) {
78   mock_function_count_map[__func__]++;
79   test::mock::stack_btm_ble_addr::btm_gen_resolvable_private_addr(cb);
80 }
btm_get_next_private_addrress_interval_ms()81 uint64_t btm_get_next_private_addrress_interval_ms() {
82   mock_function_count_map[__func__]++;
83   return test::mock::stack_btm_ble_addr::
84       btm_get_next_private_addrress_interval_ms();
85 }
btm_ble_init_pseudo_addr(tBTM_SEC_DEV_REC * p_dev_rec,const RawAddress & new_pseudo_addr)86 bool btm_ble_init_pseudo_addr(tBTM_SEC_DEV_REC* p_dev_rec,
87                               const RawAddress& new_pseudo_addr) {
88   mock_function_count_map[__func__]++;
89   return test::mock::stack_btm_ble_addr::btm_ble_init_pseudo_addr(
90       p_dev_rec, new_pseudo_addr);
91 }
btm_ble_addr_resolvable(const RawAddress & rpa,tBTM_SEC_DEV_REC * p_dev_rec)92 bool btm_ble_addr_resolvable(const RawAddress& rpa,
93                              tBTM_SEC_DEV_REC* p_dev_rec) {
94   mock_function_count_map[__func__]++;
95   return test::mock::stack_btm_ble_addr::btm_ble_addr_resolvable(rpa,
96                                                                  p_dev_rec);
97 }
btm_ble_resolve_random_addr(const RawAddress & random_bda)98 tBTM_SEC_DEV_REC* btm_ble_resolve_random_addr(const RawAddress& random_bda) {
99   mock_function_count_map[__func__]++;
100   return test::mock::stack_btm_ble_addr::btm_ble_resolve_random_addr(
101       random_bda);
102 }
btm_identity_addr_to_random_pseudo(RawAddress * bd_addr,tBLE_ADDR_TYPE * p_addr_type,bool refresh)103 bool btm_identity_addr_to_random_pseudo(RawAddress* bd_addr,
104                                         tBLE_ADDR_TYPE* p_addr_type,
105                                         bool refresh) {
106   mock_function_count_map[__func__]++;
107   return test::mock::stack_btm_ble_addr::btm_identity_addr_to_random_pseudo(
108       bd_addr, p_addr_type, refresh);
109 }
btm_identity_addr_to_random_pseudo_from_address_with_type(tBLE_BD_ADDR * address_with_type,bool refresh)110 bool btm_identity_addr_to_random_pseudo_from_address_with_type(
111     tBLE_BD_ADDR* address_with_type, bool refresh) {
112   mock_function_count_map[__func__]++;
113   return test::mock::stack_btm_ble_addr::
114       btm_identity_addr_to_random_pseudo_from_address_with_type(
115           address_with_type, refresh);
116 }
btm_random_pseudo_to_identity_addr(RawAddress * random_pseudo,tBLE_ADDR_TYPE * p_identity_addr_type)117 bool btm_random_pseudo_to_identity_addr(RawAddress* random_pseudo,
118                                         tBLE_ADDR_TYPE* p_identity_addr_type) {
119   mock_function_count_map[__func__]++;
120   return test::mock::stack_btm_ble_addr::btm_random_pseudo_to_identity_addr(
121       random_pseudo, p_identity_addr_type);
122 }
btm_ble_refresh_peer_resolvable_private_addr(const RawAddress & pseudo_bda,const RawAddress & rpa,tBTM_SEC_BLE::tADDRESS_TYPE rra_type)123 void btm_ble_refresh_peer_resolvable_private_addr(
124     const RawAddress& pseudo_bda, const RawAddress& rpa,
125     tBTM_SEC_BLE::tADDRESS_TYPE rra_type) {
126   mock_function_count_map[__func__]++;
127   test::mock::stack_btm_ble_addr::btm_ble_refresh_peer_resolvable_private_addr(
128       pseudo_bda, rpa, rra_type);
129 }
130 
131 // END mockcify generation
132