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