• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "stack/include/a2dp_sbc.h"
29 #include "test/common/mock_functions.h"
30 
31 // Original usings
32 
33 // Mocked internal structures, if any
34 
35 namespace test {
36 namespace mock {
37 namespace stack_a2dp_sbc {
38 
39 // Function state capture and return values, if needed
40 struct A2DP_AdjustCodecSbc A2DP_AdjustCodecSbc;
41 struct A2DP_BuildCodecHeaderSbc A2DP_BuildCodecHeaderSbc;
42 struct A2DP_CodecEqualsSbc A2DP_CodecEqualsSbc;
43 struct A2DP_CodecIndexStrSbc A2DP_CodecIndexStrSbc;
44 struct A2DP_CodecIndexStrSbcSink A2DP_CodecIndexStrSbcSink;
45 struct A2DP_CodecInfoStringSbc A2DP_CodecInfoStringSbc;
46 struct A2DP_CodecNameSbc A2DP_CodecNameSbc;
47 struct A2DP_CodecTypeEqualsSbc A2DP_CodecTypeEqualsSbc;
48 struct A2DP_GetAllocationMethodCodeSbc A2DP_GetAllocationMethodCodeSbc;
49 struct A2DP_GetBitrateSbc A2DP_GetBitrateSbc;
50 struct A2DP_GetChannelModeCodeSbc A2DP_GetChannelModeCodeSbc;
51 struct A2DP_GetDecoderInterfaceSbc A2DP_GetDecoderInterfaceSbc;
52 struct A2DP_GetEncoderInterfaceSbc A2DP_GetEncoderInterfaceSbc;
53 struct A2DP_GetMaxBitpoolSbc A2DP_GetMaxBitpoolSbc;
54 struct A2DP_GetMinBitpoolSbc A2DP_GetMinBitpoolSbc;
55 struct A2DP_GetNumberOfBlocksSbc A2DP_GetNumberOfBlocksSbc;
56 struct A2DP_GetNumberOfSubbandsSbc A2DP_GetNumberOfSubbandsSbc;
57 struct A2DP_GetPacketTimestampSbc A2DP_GetPacketTimestampSbc;
58 struct A2DP_GetSamplingFrequencyCodeSbc A2DP_GetSamplingFrequencyCodeSbc;
59 struct A2DP_GetSinkTrackChannelTypeSbc A2DP_GetSinkTrackChannelTypeSbc;
60 struct A2DP_GetTrackBitsPerSampleSbc A2DP_GetTrackBitsPerSampleSbc;
61 struct A2DP_GetTrackChannelCountSbc A2DP_GetTrackChannelCountSbc;
62 struct A2DP_GetTrackSampleRateSbc A2DP_GetTrackSampleRateSbc;
63 struct A2DP_InitCodecConfigSbc A2DP_InitCodecConfigSbc;
64 struct A2DP_InitCodecConfigSbcSink A2DP_InitCodecConfigSbcSink;
65 struct A2DP_InitDefaultCodecSbc A2DP_InitDefaultCodecSbc;
66 struct A2DP_IsSinkCodecSupportedSbc A2DP_IsSinkCodecSupportedSbc;
67 struct A2DP_SinkCodecIndexSbc A2DP_SinkCodecIndexSbc;
68 struct A2DP_SourceCodecIndexSbc A2DP_SourceCodecIndexSbc;
69 
70 }  // namespace stack_a2dp_sbc
71 }  // namespace mock
72 }  // namespace test
73 
74 // Mocked function return values, if any
75 namespace test {
76 namespace mock {
77 namespace stack_a2dp_sbc {
78 
79 bool A2DP_AdjustCodecSbc::return_value = false;
80 bool A2DP_BuildCodecHeaderSbc::return_value = false;
81 bool A2DP_CodecEqualsSbc::return_value = false;
82 const char* A2DP_CodecIndexStrSbc::return_value = nullptr;
83 const char* A2DP_CodecIndexStrSbcSink::return_value = nullptr;
84 std::string A2DP_CodecInfoStringSbc::return_value = std::string();
85 const char* A2DP_CodecNameSbc::return_value = nullptr;
86 bool A2DP_CodecTypeEqualsSbc::return_value = false;
87 int A2DP_GetAllocationMethodCodeSbc::return_value = 0;
88 uint32_t A2DP_GetBitrateSbc::return_value = 0;
89 int A2DP_GetChannelModeCodeSbc::return_value = 0;
90 const tA2DP_DECODER_INTERFACE* A2DP_GetDecoderInterfaceSbc::return_value = nullptr;
91 const tA2DP_ENCODER_INTERFACE* A2DP_GetEncoderInterfaceSbc::return_value = nullptr;
92 int A2DP_GetMaxBitpoolSbc::return_value = 0;
93 int A2DP_GetMinBitpoolSbc::return_value = 0;
94 int A2DP_GetNumberOfBlocksSbc::return_value = 0;
95 int A2DP_GetNumberOfSubbandsSbc::return_value = 0;
96 bool A2DP_GetPacketTimestampSbc::return_value = false;
97 int A2DP_GetSamplingFrequencyCodeSbc::return_value = 0;
98 int A2DP_GetSinkTrackChannelTypeSbc::return_value = 0;
99 int A2DP_GetTrackBitsPerSampleSbc::return_value = 0;
100 int A2DP_GetTrackChannelCountSbc::return_value = 0;
101 int A2DP_GetTrackSampleRateSbc::return_value = 0;
102 bool A2DP_InitCodecConfigSbc::return_value = false;
103 bool A2DP_InitCodecConfigSbcSink::return_value = false;
104 tA2DP_STATUS A2DP_IsSinkCodecSupportedSbc::return_value = A2DP_NOT_SUPPORTED_CODEC_TYPE;
105 btav_a2dp_codec_index_t A2DP_SinkCodecIndexSbc::return_value =
106     BTAV_A2DP_CODEC_INDEX_SOURCE_MIN;
107 btav_a2dp_codec_index_t A2DP_SourceCodecIndexSbc::return_value =
108     BTAV_A2DP_CODEC_INDEX_SOURCE_MIN;
109 
110 }  // namespace stack_a2dp_sbc
111 }  // namespace mock
112 }  // namespace test
113 
114 // Mocked functions, if any
A2DP_AdjustCodecSbc(uint8_t * p_codec_info)115 bool A2DP_AdjustCodecSbc(uint8_t* p_codec_info) {
116   inc_func_call_count(__func__);
117   return test::mock::stack_a2dp_sbc::A2DP_AdjustCodecSbc(p_codec_info);
118 }
A2DP_BuildCodecHeaderSbc(const uint8_t * p_codec_info,BT_HDR * p_buf,uint16_t frames_per_packet)119 bool A2DP_BuildCodecHeaderSbc(const uint8_t* p_codec_info, BT_HDR* p_buf,
120                               uint16_t frames_per_packet) {
121   inc_func_call_count(__func__);
122   return test::mock::stack_a2dp_sbc::A2DP_BuildCodecHeaderSbc(p_codec_info, p_buf,
123                                                               frames_per_packet);
124 }
A2DP_CodecEqualsSbc(const uint8_t * p_codec_info_a,const uint8_t * p_codec_info_b)125 bool A2DP_CodecEqualsSbc(const uint8_t* p_codec_info_a, const uint8_t* p_codec_info_b) {
126   inc_func_call_count(__func__);
127   return test::mock::stack_a2dp_sbc::A2DP_CodecEqualsSbc(p_codec_info_a, p_codec_info_b);
128 }
A2DP_CodecIndexStrSbc(void)129 const char* A2DP_CodecIndexStrSbc(void) {
130   inc_func_call_count(__func__);
131   return test::mock::stack_a2dp_sbc::A2DP_CodecIndexStrSbc();
132 }
A2DP_CodecIndexStrSbcSink(void)133 const char* A2DP_CodecIndexStrSbcSink(void) {
134   inc_func_call_count(__func__);
135   return test::mock::stack_a2dp_sbc::A2DP_CodecIndexStrSbcSink();
136 }
A2DP_CodecInfoStringSbc(const uint8_t * p_codec_info)137 std::string A2DP_CodecInfoStringSbc(const uint8_t* p_codec_info) {
138   inc_func_call_count(__func__);
139   return test::mock::stack_a2dp_sbc::A2DP_CodecInfoStringSbc(p_codec_info);
140 }
A2DP_CodecNameSbc(const uint8_t * p_codec_info)141 const char* A2DP_CodecNameSbc(const uint8_t* p_codec_info) {
142   inc_func_call_count(__func__);
143   return test::mock::stack_a2dp_sbc::A2DP_CodecNameSbc(p_codec_info);
144 }
A2DP_CodecTypeEqualsSbc(const uint8_t * p_codec_info_a,const uint8_t * p_codec_info_b)145 bool A2DP_CodecTypeEqualsSbc(const uint8_t* p_codec_info_a, const uint8_t* p_codec_info_b) {
146   inc_func_call_count(__func__);
147   return test::mock::stack_a2dp_sbc::A2DP_CodecTypeEqualsSbc(p_codec_info_a, p_codec_info_b);
148 }
A2DP_GetAllocationMethodCodeSbc(const uint8_t * p_codec_info)149 int A2DP_GetAllocationMethodCodeSbc(const uint8_t* p_codec_info) {
150   inc_func_call_count(__func__);
151   return test::mock::stack_a2dp_sbc::A2DP_GetAllocationMethodCodeSbc(p_codec_info);
152 }
A2DP_GetBitrateSbc()153 uint32_t A2DP_GetBitrateSbc() {
154   inc_func_call_count(__func__);
155   return test::mock::stack_a2dp_sbc::A2DP_GetBitrateSbc();
156 }
A2DP_GetChannelModeCodeSbc(const uint8_t * p_codec_info)157 int A2DP_GetChannelModeCodeSbc(const uint8_t* p_codec_info) {
158   inc_func_call_count(__func__);
159   return test::mock::stack_a2dp_sbc::A2DP_GetChannelModeCodeSbc(p_codec_info);
160 }
A2DP_GetDecoderInterfaceSbc(const uint8_t * p_codec_info)161 const tA2DP_DECODER_INTERFACE* A2DP_GetDecoderInterfaceSbc(const uint8_t* p_codec_info) {
162   inc_func_call_count(__func__);
163   return test::mock::stack_a2dp_sbc::A2DP_GetDecoderInterfaceSbc(p_codec_info);
164 }
A2DP_GetEncoderInterfaceSbc(const uint8_t * p_codec_info)165 const tA2DP_ENCODER_INTERFACE* A2DP_GetEncoderInterfaceSbc(const uint8_t* p_codec_info) {
166   inc_func_call_count(__func__);
167   return test::mock::stack_a2dp_sbc::A2DP_GetEncoderInterfaceSbc(p_codec_info);
168 }
A2DP_GetMaxBitpoolSbc(const uint8_t * p_codec_info)169 int A2DP_GetMaxBitpoolSbc(const uint8_t* p_codec_info) {
170   inc_func_call_count(__func__);
171   return test::mock::stack_a2dp_sbc::A2DP_GetMaxBitpoolSbc(p_codec_info);
172 }
A2DP_GetMinBitpoolSbc(const uint8_t * p_codec_info)173 int A2DP_GetMinBitpoolSbc(const uint8_t* p_codec_info) {
174   inc_func_call_count(__func__);
175   return test::mock::stack_a2dp_sbc::A2DP_GetMinBitpoolSbc(p_codec_info);
176 }
A2DP_GetNumberOfBlocksSbc(const uint8_t * p_codec_info)177 int A2DP_GetNumberOfBlocksSbc(const uint8_t* p_codec_info) {
178   inc_func_call_count(__func__);
179   return test::mock::stack_a2dp_sbc::A2DP_GetNumberOfBlocksSbc(p_codec_info);
180 }
A2DP_GetNumberOfSubbandsSbc(const uint8_t * p_codec_info)181 int A2DP_GetNumberOfSubbandsSbc(const uint8_t* p_codec_info) {
182   inc_func_call_count(__func__);
183   return test::mock::stack_a2dp_sbc::A2DP_GetNumberOfSubbandsSbc(p_codec_info);
184 }
A2DP_GetPacketTimestampSbc(const uint8_t * p_codec_info,const uint8_t * p_data,uint32_t * p_timestamp)185 bool A2DP_GetPacketTimestampSbc(const uint8_t* p_codec_info, const uint8_t* p_data,
186                                 uint32_t* p_timestamp) {
187   inc_func_call_count(__func__);
188   return test::mock::stack_a2dp_sbc::A2DP_GetPacketTimestampSbc(p_codec_info, p_data, p_timestamp);
189 }
A2DP_GetSamplingFrequencyCodeSbc(const uint8_t * p_codec_info)190 int A2DP_GetSamplingFrequencyCodeSbc(const uint8_t* p_codec_info) {
191   inc_func_call_count(__func__);
192   return test::mock::stack_a2dp_sbc::A2DP_GetSamplingFrequencyCodeSbc(p_codec_info);
193 }
A2DP_GetSinkTrackChannelTypeSbc(const uint8_t * p_codec_info)194 int A2DP_GetSinkTrackChannelTypeSbc(const uint8_t* p_codec_info) {
195   inc_func_call_count(__func__);
196   return test::mock::stack_a2dp_sbc::A2DP_GetSinkTrackChannelTypeSbc(p_codec_info);
197 }
A2DP_GetTrackBitsPerSampleSbc(const uint8_t * p_codec_info)198 int A2DP_GetTrackBitsPerSampleSbc(const uint8_t* p_codec_info) {
199   inc_func_call_count(__func__);
200   return test::mock::stack_a2dp_sbc::A2DP_GetTrackBitsPerSampleSbc(p_codec_info);
201 }
A2DP_GetTrackChannelCountSbc(const uint8_t * p_codec_info)202 int A2DP_GetTrackChannelCountSbc(const uint8_t* p_codec_info) {
203   inc_func_call_count(__func__);
204   return test::mock::stack_a2dp_sbc::A2DP_GetTrackChannelCountSbc(p_codec_info);
205 }
A2DP_GetTrackSampleRateSbc(const uint8_t * p_codec_info)206 int A2DP_GetTrackSampleRateSbc(const uint8_t* p_codec_info) {
207   inc_func_call_count(__func__);
208   return test::mock::stack_a2dp_sbc::A2DP_GetTrackSampleRateSbc(p_codec_info);
209 }
A2DP_InitCodecConfigSbc(AvdtpSepConfig * p_cfg)210 bool A2DP_InitCodecConfigSbc(AvdtpSepConfig* p_cfg) {
211   inc_func_call_count(__func__);
212   return test::mock::stack_a2dp_sbc::A2DP_InitCodecConfigSbc(p_cfg);
213 }
A2DP_InitCodecConfigSbcSink(AvdtpSepConfig * p_cfg)214 bool A2DP_InitCodecConfigSbcSink(AvdtpSepConfig* p_cfg) {
215   inc_func_call_count(__func__);
216   return test::mock::stack_a2dp_sbc::A2DP_InitCodecConfigSbcSink(p_cfg);
217 }
A2DP_InitDefaultCodecSbc(uint8_t * p_codec_info)218 void A2DP_InitDefaultCodecSbc(uint8_t* p_codec_info) {
219   inc_func_call_count(__func__);
220   test::mock::stack_a2dp_sbc::A2DP_InitDefaultCodecSbc(p_codec_info);
221 }
A2DP_IsSinkCodecSupportedSbc(const uint8_t * p_codec_info)222 tA2DP_STATUS A2DP_IsSinkCodecSupportedSbc(const uint8_t* p_codec_info) {
223   inc_func_call_count(__func__);
224   return test::mock::stack_a2dp_sbc::A2DP_IsSinkCodecSupportedSbc(p_codec_info);
225 }
A2DP_SinkCodecIndexSbc(const uint8_t * p_codec_info)226 btav_a2dp_codec_index_t A2DP_SinkCodecIndexSbc(const uint8_t* p_codec_info) {
227   inc_func_call_count(__func__);
228   return test::mock::stack_a2dp_sbc::A2DP_SinkCodecIndexSbc(p_codec_info);
229 }
A2DP_SourceCodecIndexSbc(const uint8_t * p_codec_info)230 btav_a2dp_codec_index_t A2DP_SourceCodecIndexSbc(const uint8_t* p_codec_info) {
231   inc_func_call_count(__func__);
232   return test::mock::stack_a2dp_sbc::A2DP_SourceCodecIndexSbc(p_codec_info);
233 }
234 // Mocked functions complete
235 // END mockcify generation
236