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 // Mock include file to share data between tests and mock
25 #include "test/mock/mock_btif_config.h"
26 
27 #include <cstdint>
28 #include <string>
29 
30 #include "test/common/mock_functions.h"
31 #include "types/raw_address.h"
32 
33 // Mocked compile conditionals, if any
34 // Mocked internal structures, if any
35 
36 namespace test {
37 namespace mock {
38 namespace btif_config {
39 
40 // Function state capture and return values, if needed
41 struct btif_get_device_clockoffset btif_get_device_clockoffset;
42 struct btif_set_device_clockoffset btif_set_device_clockoffset;
43 struct btif_config_exist btif_config_exist;
44 struct btif_config_get_int btif_config_get_int;
45 struct btif_config_set_int btif_config_set_int;
46 struct btif_config_get_uint64 btif_config_get_uint64;
47 struct btif_config_set_uint64 btif_config_set_uint64;
48 struct btif_config_get_str btif_config_get_str;
49 struct btif_config_set_str btif_config_set_str;
50 struct btif_config_get_bin btif_config_get_bin;
51 struct btif_config_get_bin_length btif_config_get_bin_length;
52 struct btif_config_set_bin btif_config_set_bin;
53 struct btif_config_get_paired_devices btif_config_get_paired_devices;
54 struct btif_config_remove btif_config_remove;
55 struct btif_config_remove_device btif_config_remove_device;
56 struct btif_config_clear btif_config_clear;
57 
58 }  // namespace btif_config
59 }  // namespace mock
60 }  // namespace test
61 
62 // Mocked functions, if any
btif_get_device_clockoffset(const RawAddress & bda,int * p_clock_offset)63 bool btif_get_device_clockoffset(const RawAddress& bda, int* p_clock_offset) {
64   inc_func_call_count(__func__);
65   return test::mock::btif_config::btif_get_device_clockoffset(bda, p_clock_offset);
66 }
btif_set_device_clockoffset(const RawAddress & bda,int clock_offset)67 bool btif_set_device_clockoffset(const RawAddress& bda, int clock_offset) {
68   inc_func_call_count(__func__);
69   return test::mock::btif_config::btif_set_device_clockoffset(bda, clock_offset);
70 }
btif_config_exist(const std::string & section,const std::string & key)71 bool btif_config_exist(const std::string& section, const std::string& key) {
72   inc_func_call_count(__func__);
73   return test::mock::btif_config::btif_config_exist(section, key);
74 }
btif_config_get_int(const std::string & section,const std::string & key,int * value)75 bool btif_config_get_int(const std::string& section, const std::string& key,
76                          int* value) {
77   inc_func_call_count(__func__);
78   return test::mock::btif_config::btif_config_get_int(section, key, value);
79 }
btif_config_set_int(const std::string & section,const std::string & key,int value)80 bool btif_config_set_int(const std::string& section, const std::string& key,
81                          int value) {
82   inc_func_call_count(__func__);
83   return test::mock::btif_config::btif_config_set_int(section, key, value);
84 }
btif_config_get_uint64(const std::string & section,const std::string & key,uint64_t * value)85 bool btif_config_get_uint64(const std::string& section, const std::string& key,
86                             uint64_t* value) {
87   inc_func_call_count(__func__);
88   return test::mock::btif_config::btif_config_get_uint64(section, key, value);
89 }
btif_config_set_uint64(const std::string & section,const std::string & key,uint64_t value)90 bool btif_config_set_uint64(const std::string& section, const std::string& key,
91                             uint64_t value) {
92   inc_func_call_count(__func__);
93   return test::mock::btif_config::btif_config_set_uint64(section, key, value);
94 }
btif_config_get_str(const std::string & section,const std::string & key,char * value,int * size_bytes)95 bool btif_config_get_str(const std::string& section, const std::string& key,
96                          char* value, int* size_bytes) {
97   inc_func_call_count(__func__);
98   return test::mock::btif_config::btif_config_get_str(section, key, value,
99                                                       size_bytes);
100 }
btif_config_set_str(const std::string & section,const std::string & key,const std::string & value)101 bool btif_config_set_str(const std::string& section, const std::string& key,
102                          const std::string& value) {
103   inc_func_call_count(__func__);
104   return test::mock::btif_config::btif_config_set_str(section, key, value);
105 }
btif_config_get_bin(const std::string & section,const std::string & key,uint8_t * value,size_t * length)106 bool btif_config_get_bin(const std::string& section, const std::string& key,
107                          uint8_t* value, size_t* length) {
108   inc_func_call_count(__func__);
109   return test::mock::btif_config::btif_config_get_bin(section, key, value,
110                                                       length);
111 }
btif_config_get_bin_length(const std::string & section,const std::string & key)112 size_t btif_config_get_bin_length(const std::string& section,
113                                   const std::string& key) {
114   inc_func_call_count(__func__);
115   return test::mock::btif_config::btif_config_get_bin_length(section, key);
116 }
btif_config_set_bin(const std::string & section,const std::string & key,const uint8_t * value,size_t length)117 bool btif_config_set_bin(const std::string& section, const std::string& key,
118                          const uint8_t* value, size_t length) {
119   inc_func_call_count(__func__);
120   return test::mock::btif_config::btif_config_set_bin(section, key, value,
121                                                       length);
122 }
btif_config_get_paired_devices()123 std::vector<RawAddress> btif_config_get_paired_devices() {
124   inc_func_call_count(__func__);
125   return test::mock::btif_config::btif_config_get_paired_devices();
126 }
btif_config_remove(const std::string & section,const std::string & key)127 bool btif_config_remove(const std::string& section, const std::string& key) {
128   inc_func_call_count(__func__);
129   return test::mock::btif_config::btif_config_remove(section, key);
130 }
btif_config_clear(void)131 bool btif_config_clear(void) {
132   inc_func_call_count(__func__);
133   return test::mock::btif_config::btif_config_clear();
134 }
135 
136 // END mockcify generation
137