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