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:18
20 *
21 * mockcify.pl ver 0.2
22 */
23
24 #include <cstdint>
25 #include <functional>
26 #include <map>
27 #include <string>
28
29 extern std::map<std::string, int> mock_function_count_map;
30
31 // Original included files, if any
32 // NOTE: Since this is a mock file with mock definitions some number of
33 // include files may not be required. The include-what-you-use
34 // still applies, but crafting proper inclusion is out of scope
35 // for this effort. This compilation unit may compile as-is, or
36 // may need attention to prune the inclusion set.
37
38 // Mock include file to share data between tests and mock
39 #include "test/mock/mock_btif_config.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 btif_config {
51
52 // Function state capture and return values, if needed
53 struct btif_get_device_type btif_get_device_type;
54 struct btif_get_address_type btif_get_address_type;
55 struct btif_config_exist btif_config_exist;
56 struct btif_config_get_int btif_config_get_int;
57 struct btif_config_set_int btif_config_set_int;
58 struct btif_config_get_uint64 btif_config_get_uint64;
59 struct btif_config_set_uint64 btif_config_set_uint64;
60 struct btif_config_get_str btif_config_get_str;
61 struct btif_config_set_str btif_config_set_str;
62 struct btif_config_get_bin btif_config_get_bin;
63 struct btif_config_get_bin_length btif_config_get_bin_length;
64 struct btif_config_set_bin btif_config_set_bin;
65 struct btif_config_get_paired_devices btif_config_get_paired_devices;
66 struct btif_config_remove btif_config_remove;
67 struct btif_config_save btif_config_save;
68 struct btif_config_flush btif_config_flush;
69 struct btif_config_clear btif_config_clear;
70 struct btif_debug_config_dump btif_debug_config_dump;
71
72 } // namespace btif_config
73 } // namespace mock
74 } // namespace test
75
76 // Mocked functions, if any
btif_get_device_type(const RawAddress & bda,int * p_device_type)77 bool btif_get_device_type(const RawAddress& bda, int* p_device_type) {
78 mock_function_count_map[__func__]++;
79 return test::mock::btif_config::btif_get_device_type(bda, p_device_type);
80 }
btif_get_address_type(const RawAddress & bda,tBLE_ADDR_TYPE * p_addr_type)81 bool btif_get_address_type(const RawAddress& bda, tBLE_ADDR_TYPE* p_addr_type) {
82 mock_function_count_map[__func__]++;
83 return test::mock::btif_config::btif_get_address_type(bda, p_addr_type);
84 }
btif_config_exist(const std::string & section,const std::string & key)85 bool btif_config_exist(const std::string& section, const std::string& key) {
86 mock_function_count_map[__func__]++;
87 return test::mock::btif_config::btif_config_exist(section, key);
88 }
btif_config_get_int(const std::string & section,const std::string & key,int * value)89 bool btif_config_get_int(const std::string& section, const std::string& key,
90 int* value) {
91 mock_function_count_map[__func__]++;
92 return test::mock::btif_config::btif_config_get_int(section, key, value);
93 }
btif_config_set_int(const std::string & section,const std::string & key,int value)94 bool btif_config_set_int(const std::string& section, const std::string& key,
95 int value) {
96 mock_function_count_map[__func__]++;
97 return test::mock::btif_config::btif_config_set_int(section, key, value);
98 }
btif_config_get_uint64(const std::string & section,const std::string & key,uint64_t * value)99 bool btif_config_get_uint64(const std::string& section, const std::string& key,
100 uint64_t* value) {
101 mock_function_count_map[__func__]++;
102 return test::mock::btif_config::btif_config_get_uint64(section, key, value);
103 }
btif_config_set_uint64(const std::string & section,const std::string & key,uint64_t value)104 bool btif_config_set_uint64(const std::string& section, const std::string& key,
105 uint64_t value) {
106 mock_function_count_map[__func__]++;
107 return test::mock::btif_config::btif_config_set_uint64(section, key, value);
108 }
btif_config_get_str(const std::string & section,const std::string & key,char * value,int * size_bytes)109 bool btif_config_get_str(const std::string& section, const std::string& key,
110 char* value, int* size_bytes) {
111 mock_function_count_map[__func__]++;
112 return test::mock::btif_config::btif_config_get_str(section, key, value,
113 size_bytes);
114 }
btif_config_set_str(const std::string & section,const std::string & key,const std::string & value)115 bool btif_config_set_str(const std::string& section, const std::string& key,
116 const std::string& value) {
117 mock_function_count_map[__func__]++;
118 return test::mock::btif_config::btif_config_set_str(section, key, value);
119 }
btif_config_get_bin(const std::string & section,const std::string & key,uint8_t * value,size_t * length)120 bool btif_config_get_bin(const std::string& section, const std::string& key,
121 uint8_t* value, size_t* length) {
122 mock_function_count_map[__func__]++;
123 return test::mock::btif_config::btif_config_get_bin(section, key, value,
124 length);
125 }
btif_config_get_bin_length(const std::string & section,const std::string & key)126 size_t btif_config_get_bin_length(const std::string& section,
127 const std::string& key) {
128 mock_function_count_map[__func__]++;
129 return test::mock::btif_config::btif_config_get_bin_length(section, key);
130 }
btif_config_set_bin(const std::string & section,const std::string & key,const uint8_t * value,size_t length)131 bool btif_config_set_bin(const std::string& section, const std::string& key,
132 const uint8_t* value, size_t length) {
133 mock_function_count_map[__func__]++;
134 return test::mock::btif_config::btif_config_set_bin(section, key, value,
135 length);
136 }
btif_config_get_paired_devices()137 std::vector<RawAddress> btif_config_get_paired_devices() {
138 mock_function_count_map[__func__]++;
139 return test::mock::btif_config::btif_config_get_paired_devices();
140 }
btif_config_remove(const std::string & section,const std::string & key)141 bool btif_config_remove(const std::string& section, const std::string& key) {
142 mock_function_count_map[__func__]++;
143 return test::mock::btif_config::btif_config_remove(section, key);
144 }
btif_config_save(void)145 void btif_config_save(void) {
146 mock_function_count_map[__func__]++;
147 test::mock::btif_config::btif_config_save();
148 }
btif_config_flush(void)149 void btif_config_flush(void) {
150 mock_function_count_map[__func__]++;
151 test::mock::btif_config::btif_config_flush();
152 }
btif_config_clear(void)153 bool btif_config_clear(void) {
154 mock_function_count_map[__func__]++;
155 return test::mock::btif_config::btif_config_clear();
156 }
btif_debug_config_dump(int fd)157 void btif_debug_config_dump(int fd) {
158 mock_function_count_map[__func__]++;
159 test::mock::btif_config::btif_debug_config_dump(fd);
160 }
161
162 // END mockcify generation
163