1 /*
2 * Copyright 2022 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 * Generated mock file from original source file
18 * Functions generated:34
19 *
20 * mockcify.pl ver 0.5.0
21 */
22 // Mock include file to share data between tests and mock
23 #include "test/mock/mock_stack_a2dp_sbc.h"
24
25 #include <cstdint>
26 #include <string>
27
28 #include "test/common/mock_functions.h"
29
30 // Original usings
31
32 // Mocked internal structures, if any
33
34 namespace test {
35 namespace mock {
36 namespace stack_a2dp_sbc {
37
38 // Function state capture and return values, if needed
39 struct A2DP_AdjustCodecSbc A2DP_AdjustCodecSbc;
40 struct A2DP_BuildCodecHeaderSbc A2DP_BuildCodecHeaderSbc;
41 struct A2DP_CodecEqualsSbc A2DP_CodecEqualsSbc;
42 struct A2DP_CodecIndexStrSbc A2DP_CodecIndexStrSbc;
43 struct A2DP_CodecIndexStrSbcSink A2DP_CodecIndexStrSbcSink;
44 struct A2DP_CodecInfoStringSbc A2DP_CodecInfoStringSbc;
45 struct A2DP_CodecNameSbc A2DP_CodecNameSbc;
46 struct A2DP_CodecTypeEqualsSbc A2DP_CodecTypeEqualsSbc;
47 struct A2DP_GetAllocationMethodCodeSbc A2DP_GetAllocationMethodCodeSbc;
48 struct A2DP_GetBitrateSbc A2DP_GetBitrateSbc;
49 struct A2DP_GetChannelModeCodeSbc A2DP_GetChannelModeCodeSbc;
50 struct A2DP_GetDecoderInterfaceSbc A2DP_GetDecoderInterfaceSbc;
51 struct A2DP_GetEncoderInterfaceSbc A2DP_GetEncoderInterfaceSbc;
52 struct A2DP_GetMaxBitpoolSbc A2DP_GetMaxBitpoolSbc;
53 struct A2DP_GetMinBitpoolSbc A2DP_GetMinBitpoolSbc;
54 struct A2DP_GetNumberOfBlocksSbc A2DP_GetNumberOfBlocksSbc;
55 struct A2DP_GetNumberOfSubbandsSbc A2DP_GetNumberOfSubbandsSbc;
56 struct A2DP_GetPacketTimestampSbc A2DP_GetPacketTimestampSbc;
57 struct A2DP_GetSamplingFrequencyCodeSbc A2DP_GetSamplingFrequencyCodeSbc;
58 struct A2DP_GetSinkTrackChannelTypeSbc A2DP_GetSinkTrackChannelTypeSbc;
59 struct A2DP_GetTrackBitsPerSampleSbc A2DP_GetTrackBitsPerSampleSbc;
60 struct A2DP_GetTrackChannelCountSbc A2DP_GetTrackChannelCountSbc;
61 struct A2DP_GetTrackSampleRateSbc A2DP_GetTrackSampleRateSbc;
62 struct A2DP_InitCodecConfigSbc A2DP_InitCodecConfigSbc;
63 struct A2DP_InitCodecConfigSbcSink A2DP_InitCodecConfigSbcSink;
64 struct A2DP_InitDefaultCodecSbc A2DP_InitDefaultCodecSbc;
65 struct A2DP_IsPeerSinkCodecValidSbc A2DP_IsPeerSinkCodecValidSbc;
66 struct A2DP_IsPeerSourceCodecSupportedSbc A2DP_IsPeerSourceCodecSupportedSbc;
67 struct A2DP_IsPeerSourceCodecValidSbc A2DP_IsPeerSourceCodecValidSbc;
68 struct A2DP_IsSinkCodecSupportedSbc A2DP_IsSinkCodecSupportedSbc;
69 struct A2DP_IsSinkCodecValidSbc A2DP_IsSinkCodecValidSbc;
70 struct A2DP_IsSourceCodecValidSbc A2DP_IsSourceCodecValidSbc;
71 struct A2DP_SinkCodecIndexSbc A2DP_SinkCodecIndexSbc;
72 struct A2DP_SourceCodecIndexSbc A2DP_SourceCodecIndexSbc;
73
74 } // namespace stack_a2dp_sbc
75 } // namespace mock
76 } // namespace test
77
78 // Mocked function return values, if any
79 namespace test {
80 namespace mock {
81 namespace stack_a2dp_sbc {
82
83 bool A2DP_AdjustCodecSbc::return_value = false;
84 bool A2DP_BuildCodecHeaderSbc::return_value = false;
85 bool A2DP_CodecEqualsSbc::return_value = false;
86 const char* A2DP_CodecIndexStrSbc::return_value = nullptr;
87 const char* A2DP_CodecIndexStrSbcSink::return_value = nullptr;
88 std::string A2DP_CodecInfoStringSbc::return_value = std::string();
89 const char* A2DP_CodecNameSbc::return_value = nullptr;
90 bool A2DP_CodecTypeEqualsSbc::return_value = false;
91 int A2DP_GetAllocationMethodCodeSbc::return_value = 0;
92 uint32_t A2DP_GetBitrateSbc::return_value = 0;
93 int A2DP_GetChannelModeCodeSbc::return_value = 0;
94 const tA2DP_DECODER_INTERFACE* A2DP_GetDecoderInterfaceSbc::return_value =
95 nullptr;
96 const tA2DP_ENCODER_INTERFACE* A2DP_GetEncoderInterfaceSbc::return_value =
97 nullptr;
98 int A2DP_GetMaxBitpoolSbc::return_value = 0;
99 int A2DP_GetMinBitpoolSbc::return_value = 0;
100 int A2DP_GetNumberOfBlocksSbc::return_value = 0;
101 int A2DP_GetNumberOfSubbandsSbc::return_value = 0;
102 bool A2DP_GetPacketTimestampSbc::return_value = false;
103 int A2DP_GetSamplingFrequencyCodeSbc::return_value = 0;
104 int A2DP_GetSinkTrackChannelTypeSbc::return_value = 0;
105 int A2DP_GetTrackBitsPerSampleSbc::return_value = 0;
106 int A2DP_GetTrackChannelCountSbc::return_value = 0;
107 int A2DP_GetTrackSampleRateSbc::return_value = 0;
108 bool A2DP_InitCodecConfigSbc::return_value = false;
109 bool A2DP_InitCodecConfigSbcSink::return_value = false;
110 bool A2DP_IsPeerSinkCodecValidSbc::return_value = false;
111 bool A2DP_IsPeerSourceCodecSupportedSbc::return_value = false;
112 bool A2DP_IsPeerSourceCodecValidSbc::return_value = false;
113 bool A2DP_IsSinkCodecSupportedSbc::return_value = false;
114 bool A2DP_IsSinkCodecValidSbc::return_value = false;
115 bool A2DP_IsSourceCodecValidSbc::return_value = false;
116 btav_a2dp_codec_index_t A2DP_SinkCodecIndexSbc::return_value =
117 BTAV_A2DP_CODEC_INDEX_SOURCE_MIN;
118 btav_a2dp_codec_index_t A2DP_SourceCodecIndexSbc::return_value =
119 BTAV_A2DP_CODEC_INDEX_SOURCE_MIN;
120
121 } // namespace stack_a2dp_sbc
122 } // namespace mock
123 } // namespace test
124
125 // Mocked functions, if any
A2DP_AdjustCodecSbc(uint8_t * p_codec_info)126 bool A2DP_AdjustCodecSbc(uint8_t* p_codec_info) {
127 inc_func_call_count(__func__);
128 return test::mock::stack_a2dp_sbc::A2DP_AdjustCodecSbc(p_codec_info);
129 }
A2DP_BuildCodecHeaderSbc(const uint8_t * p_codec_info,BT_HDR * p_buf,uint16_t frames_per_packet)130 bool A2DP_BuildCodecHeaderSbc(const uint8_t* p_codec_info, BT_HDR* p_buf,
131 uint16_t frames_per_packet) {
132 inc_func_call_count(__func__);
133 return test::mock::stack_a2dp_sbc::A2DP_BuildCodecHeaderSbc(
134 p_codec_info, p_buf, frames_per_packet);
135 }
A2DP_CodecEqualsSbc(const uint8_t * p_codec_info_a,const uint8_t * p_codec_info_b)136 bool A2DP_CodecEqualsSbc(const uint8_t* p_codec_info_a,
137 const uint8_t* p_codec_info_b) {
138 inc_func_call_count(__func__);
139 return test::mock::stack_a2dp_sbc::A2DP_CodecEqualsSbc(p_codec_info_a,
140 p_codec_info_b);
141 }
A2DP_CodecIndexStrSbc(void)142 const char* A2DP_CodecIndexStrSbc(void) {
143 inc_func_call_count(__func__);
144 return test::mock::stack_a2dp_sbc::A2DP_CodecIndexStrSbc();
145 }
A2DP_CodecIndexStrSbcSink(void)146 const char* A2DP_CodecIndexStrSbcSink(void) {
147 inc_func_call_count(__func__);
148 return test::mock::stack_a2dp_sbc::A2DP_CodecIndexStrSbcSink();
149 }
A2DP_CodecInfoStringSbc(const uint8_t * p_codec_info)150 std::string A2DP_CodecInfoStringSbc(const uint8_t* p_codec_info) {
151 inc_func_call_count(__func__);
152 return test::mock::stack_a2dp_sbc::A2DP_CodecInfoStringSbc(p_codec_info);
153 }
A2DP_CodecNameSbc(const uint8_t * p_codec_info)154 const char* A2DP_CodecNameSbc(const uint8_t* p_codec_info) {
155 inc_func_call_count(__func__);
156 return test::mock::stack_a2dp_sbc::A2DP_CodecNameSbc(p_codec_info);
157 }
A2DP_CodecTypeEqualsSbc(const uint8_t * p_codec_info_a,const uint8_t * p_codec_info_b)158 bool A2DP_CodecTypeEqualsSbc(const uint8_t* p_codec_info_a,
159 const uint8_t* p_codec_info_b) {
160 inc_func_call_count(__func__);
161 return test::mock::stack_a2dp_sbc::A2DP_CodecTypeEqualsSbc(p_codec_info_a,
162 p_codec_info_b);
163 }
A2DP_GetAllocationMethodCodeSbc(const uint8_t * p_codec_info)164 int A2DP_GetAllocationMethodCodeSbc(const uint8_t* p_codec_info) {
165 inc_func_call_count(__func__);
166 return test::mock::stack_a2dp_sbc::A2DP_GetAllocationMethodCodeSbc(
167 p_codec_info);
168 }
A2DP_GetBitrateSbc()169 uint32_t A2DP_GetBitrateSbc() {
170 inc_func_call_count(__func__);
171 return test::mock::stack_a2dp_sbc::A2DP_GetBitrateSbc();
172 }
A2DP_GetChannelModeCodeSbc(const uint8_t * p_codec_info)173 int A2DP_GetChannelModeCodeSbc(const uint8_t* p_codec_info) {
174 inc_func_call_count(__func__);
175 return test::mock::stack_a2dp_sbc::A2DP_GetChannelModeCodeSbc(p_codec_info);
176 }
A2DP_GetDecoderInterfaceSbc(const uint8_t * p_codec_info)177 const tA2DP_DECODER_INTERFACE* A2DP_GetDecoderInterfaceSbc(
178 const uint8_t* p_codec_info) {
179 inc_func_call_count(__func__);
180 return test::mock::stack_a2dp_sbc::A2DP_GetDecoderInterfaceSbc(p_codec_info);
181 }
A2DP_GetEncoderInterfaceSbc(const uint8_t * p_codec_info)182 const tA2DP_ENCODER_INTERFACE* A2DP_GetEncoderInterfaceSbc(
183 const uint8_t* p_codec_info) {
184 inc_func_call_count(__func__);
185 return test::mock::stack_a2dp_sbc::A2DP_GetEncoderInterfaceSbc(p_codec_info);
186 }
A2DP_GetMaxBitpoolSbc(const uint8_t * p_codec_info)187 int A2DP_GetMaxBitpoolSbc(const uint8_t* p_codec_info) {
188 inc_func_call_count(__func__);
189 return test::mock::stack_a2dp_sbc::A2DP_GetMaxBitpoolSbc(p_codec_info);
190 }
A2DP_GetMinBitpoolSbc(const uint8_t * p_codec_info)191 int A2DP_GetMinBitpoolSbc(const uint8_t* p_codec_info) {
192 inc_func_call_count(__func__);
193 return test::mock::stack_a2dp_sbc::A2DP_GetMinBitpoolSbc(p_codec_info);
194 }
A2DP_GetNumberOfBlocksSbc(const uint8_t * p_codec_info)195 int A2DP_GetNumberOfBlocksSbc(const uint8_t* p_codec_info) {
196 inc_func_call_count(__func__);
197 return test::mock::stack_a2dp_sbc::A2DP_GetNumberOfBlocksSbc(p_codec_info);
198 }
A2DP_GetNumberOfSubbandsSbc(const uint8_t * p_codec_info)199 int A2DP_GetNumberOfSubbandsSbc(const uint8_t* p_codec_info) {
200 inc_func_call_count(__func__);
201 return test::mock::stack_a2dp_sbc::A2DP_GetNumberOfSubbandsSbc(p_codec_info);
202 }
A2DP_GetPacketTimestampSbc(const uint8_t * p_codec_info,const uint8_t * p_data,uint32_t * p_timestamp)203 bool A2DP_GetPacketTimestampSbc(const uint8_t* p_codec_info,
204 const uint8_t* p_data, uint32_t* p_timestamp) {
205 inc_func_call_count(__func__);
206 return test::mock::stack_a2dp_sbc::A2DP_GetPacketTimestampSbc(
207 p_codec_info, p_data, p_timestamp);
208 }
A2DP_GetSamplingFrequencyCodeSbc(const uint8_t * p_codec_info)209 int A2DP_GetSamplingFrequencyCodeSbc(const uint8_t* p_codec_info) {
210 inc_func_call_count(__func__);
211 return test::mock::stack_a2dp_sbc::A2DP_GetSamplingFrequencyCodeSbc(
212 p_codec_info);
213 }
A2DP_GetSinkTrackChannelTypeSbc(const uint8_t * p_codec_info)214 int A2DP_GetSinkTrackChannelTypeSbc(const uint8_t* p_codec_info) {
215 inc_func_call_count(__func__);
216 return test::mock::stack_a2dp_sbc::A2DP_GetSinkTrackChannelTypeSbc(
217 p_codec_info);
218 }
A2DP_GetTrackBitsPerSampleSbc(const uint8_t * p_codec_info)219 int A2DP_GetTrackBitsPerSampleSbc(const uint8_t* p_codec_info) {
220 inc_func_call_count(__func__);
221 return test::mock::stack_a2dp_sbc::A2DP_GetTrackBitsPerSampleSbc(
222 p_codec_info);
223 }
A2DP_GetTrackChannelCountSbc(const uint8_t * p_codec_info)224 int A2DP_GetTrackChannelCountSbc(const uint8_t* p_codec_info) {
225 inc_func_call_count(__func__);
226 return test::mock::stack_a2dp_sbc::A2DP_GetTrackChannelCountSbc(p_codec_info);
227 }
A2DP_GetTrackSampleRateSbc(const uint8_t * p_codec_info)228 int A2DP_GetTrackSampleRateSbc(const uint8_t* p_codec_info) {
229 inc_func_call_count(__func__);
230 return test::mock::stack_a2dp_sbc::A2DP_GetTrackSampleRateSbc(p_codec_info);
231 }
A2DP_InitCodecConfigSbc(AvdtpSepConfig * p_cfg)232 bool A2DP_InitCodecConfigSbc(AvdtpSepConfig* p_cfg) {
233 inc_func_call_count(__func__);
234 return test::mock::stack_a2dp_sbc::A2DP_InitCodecConfigSbc(p_cfg);
235 }
A2DP_InitCodecConfigSbcSink(AvdtpSepConfig * p_cfg)236 bool A2DP_InitCodecConfigSbcSink(AvdtpSepConfig* p_cfg) {
237 inc_func_call_count(__func__);
238 return test::mock::stack_a2dp_sbc::A2DP_InitCodecConfigSbcSink(p_cfg);
239 }
A2DP_InitDefaultCodecSbc(uint8_t * p_codec_info)240 void A2DP_InitDefaultCodecSbc(uint8_t* p_codec_info) {
241 inc_func_call_count(__func__);
242 test::mock::stack_a2dp_sbc::A2DP_InitDefaultCodecSbc(p_codec_info);
243 }
A2DP_IsPeerSinkCodecValidSbc(const uint8_t * p_codec_info)244 bool A2DP_IsPeerSinkCodecValidSbc(const uint8_t* p_codec_info) {
245 inc_func_call_count(__func__);
246 return test::mock::stack_a2dp_sbc::A2DP_IsPeerSinkCodecValidSbc(p_codec_info);
247 }
A2DP_IsPeerSourceCodecSupportedSbc(const uint8_t * p_codec_info)248 bool A2DP_IsPeerSourceCodecSupportedSbc(const uint8_t* p_codec_info) {
249 inc_func_call_count(__func__);
250 return test::mock::stack_a2dp_sbc::A2DP_IsPeerSourceCodecSupportedSbc(
251 p_codec_info);
252 }
A2DP_IsPeerSourceCodecValidSbc(const uint8_t * p_codec_info)253 bool A2DP_IsPeerSourceCodecValidSbc(const uint8_t* p_codec_info) {
254 inc_func_call_count(__func__);
255 return test::mock::stack_a2dp_sbc::A2DP_IsPeerSourceCodecValidSbc(
256 p_codec_info);
257 }
A2DP_IsSinkCodecSupportedSbc(const uint8_t * p_codec_info)258 bool A2DP_IsSinkCodecSupportedSbc(const uint8_t* p_codec_info) {
259 inc_func_call_count(__func__);
260 return test::mock::stack_a2dp_sbc::A2DP_IsSinkCodecSupportedSbc(p_codec_info);
261 }
A2DP_IsSinkCodecValidSbc(const uint8_t * p_codec_info)262 bool A2DP_IsSinkCodecValidSbc(const uint8_t* p_codec_info) {
263 inc_func_call_count(__func__);
264 return test::mock::stack_a2dp_sbc::A2DP_IsSinkCodecValidSbc(p_codec_info);
265 }
A2DP_IsSourceCodecValidSbc(const uint8_t * p_codec_info)266 bool A2DP_IsSourceCodecValidSbc(const uint8_t* p_codec_info) {
267 inc_func_call_count(__func__);
268 return test::mock::stack_a2dp_sbc::A2DP_IsSourceCodecValidSbc(p_codec_info);
269 }
A2DP_SinkCodecIndexSbc(const uint8_t * p_codec_info)270 btav_a2dp_codec_index_t A2DP_SinkCodecIndexSbc(const uint8_t* p_codec_info) {
271 inc_func_call_count(__func__);
272 return test::mock::stack_a2dp_sbc::A2DP_SinkCodecIndexSbc(p_codec_info);
273 }
A2DP_SourceCodecIndexSbc(const uint8_t * p_codec_info)274 btav_a2dp_codec_index_t A2DP_SourceCodecIndexSbc(const uint8_t* p_codec_info) {
275 inc_func_call_count(__func__);
276 return test::mock::stack_a2dp_sbc::A2DP_SourceCodecIndexSbc(p_codec_info);
277 }
278 // Mocked functions complete
279 // END mockcify generation
280