1 /*
2  * Copyright 2023 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 #pragma once
17 
18 /*
19  * Generated mock file from original source file
20  *   Functions generated:10
21  *
22  *  mockcify.pl ver 0.6.1
23  */
24 
25 #include <lc3.h>
26 
27 #include <cstdint>
28 #include <functional>
29 #include <map>
30 #include <string>
31 
32 #include "test/common/mock_functions.h"
33 
34 namespace test {
35 namespace mock {
36 namespace embdrv_lc3 {
37 // Shared state between mocked functions and tests
38 // Name: lc3_decode
39 // Params: struct lc3_decoder* decoder, const void* in, int nbytes, enum
40 // lc3_pcm_format fmt, void* pcm, int stride Return: int
41 struct lc3_decode {
42   static int return_value;
43   std::function<int(struct lc3_decoder* decoder, const void* in, int nbytes,
44                     enum lc3_pcm_format fmt, void* pcm, int stride)>
45       body{[](struct lc3_decoder* decoder, const void* in, int nbytes,
46               enum lc3_pcm_format fmt, void* pcm,
47               int stride) { return return_value; }};
operatorlc3_decode48   int operator()(struct lc3_decoder* decoder, const void* in, int nbytes,
49                  enum lc3_pcm_format fmt, void* pcm, int stride) {
50     return body(decoder, in, nbytes, fmt, pcm, stride);
51   };
52 };
53 extern struct lc3_decode lc3_decode;
54 
55 // Name: lc3_decoder_size
56 // Params: int dt_us, int sr_hz
57 // Return: unsigned
58 struct lc3_decoder_size {
59   static unsigned return_value;
60   std::function<unsigned(int dt_us, int sr_hz)> body{
61       [](int dt_us, int sr_hz) { return return_value; }};
operatorlc3_decoder_size62   unsigned operator()(int dt_us, int sr_hz) { return body(dt_us, sr_hz); };
63 };
64 extern struct lc3_decoder_size lc3_decoder_size;
65 
66 // Name: lc3_delay_samples
67 // Params: int dt_us, int sr_hz
68 // Return: int
69 struct lc3_delay_samples {
70   static int return_value;
71   std::function<int(int dt_us, int sr_hz)> body{
72       [](int dt_us, int sr_hz) { return return_value; }};
operatorlc3_delay_samples73   int operator()(int dt_us, int sr_hz) { return body(dt_us, sr_hz); };
74 };
75 extern struct lc3_delay_samples lc3_delay_samples;
76 
77 // Name: lc3_encode
78 // Params: struct lc3_encoder* encoder, enum lc3_pcm_format fmt, const void*
79 // pcm, int stride, int nbytes, void* out Return: int
80 struct lc3_encode {
81   static int return_value;
82   std::function<int(struct lc3_encoder* encoder, enum lc3_pcm_format fmt,
83                     const void* pcm, int stride, int nbytes, void* out)>
84       body{[](struct lc3_encoder* encoder, enum lc3_pcm_format fmt,
85               const void* pcm, int stride, int nbytes,
86               void* out) { return return_value; }};
operatorlc3_encode87   int operator()(struct lc3_encoder* encoder, enum lc3_pcm_format fmt,
88                  const void* pcm, int stride, int nbytes, void* out) {
89     return body(encoder, fmt, pcm, stride, nbytes, out);
90   };
91 };
92 extern struct lc3_encode lc3_encode;
93 
94 // Name: lc3_encoder_size
95 // Params: int dt_us, int sr_hz
96 // Return: unsigned
97 struct lc3_encoder_size {
98   static unsigned return_value;
99   std::function<unsigned(int dt_us, int sr_hz)> body{
100       [](int dt_us, int sr_hz) { return return_value; }};
operatorlc3_encoder_size101   unsigned operator()(int dt_us, int sr_hz) { return body(dt_us, sr_hz); };
102 };
103 extern struct lc3_encoder_size lc3_encoder_size;
104 
105 // Name: lc3_frame_bytes
106 // Params: int dt_us, int bitrate
107 // Return: int
108 struct lc3_frame_bytes {
109   static int return_value;
110   std::function<int(int dt_us, int bitrate)> body{
111       [](int dt_us, int bitrate) { return return_value; }};
operatorlc3_frame_bytes112   int operator()(int dt_us, int bitrate) { return body(dt_us, bitrate); };
113 };
114 extern struct lc3_frame_bytes lc3_frame_bytes;
115 
116 // Name: lc3_frame_samples
117 // Params: int dt_us, int sr_hz
118 // Return: int
119 struct lc3_frame_samples {
120   static int return_value;
121   std::function<int(int dt_us, int sr_hz)> body{
122       [](int dt_us, int sr_hz) { return return_value; }};
operatorlc3_frame_samples123   int operator()(int dt_us, int sr_hz) { return body(dt_us, sr_hz); };
124 };
125 extern struct lc3_frame_samples lc3_frame_samples;
126 
127 // Name: lc3_resolve_bitrate
128 // Params: int dt_us, int nbytes
129 // Return: int
130 struct lc3_resolve_bitrate {
131   static int return_value;
132   std::function<int(int dt_us, int nbytes)> body{
133       [](int dt_us, int nbytes) { return return_value; }};
operatorlc3_resolve_bitrate134   int operator()(int dt_us, int nbytes) { return body(dt_us, nbytes); };
135 };
136 extern struct lc3_resolve_bitrate lc3_resolve_bitrate;
137 
138 // Name: lc3_setup_decoder
139 // Params: int dt_us, int sr_hz, int sr_pcm_hz, void* mem
140 // Return: struct lc3_decoder*
141 struct lc3_setup_decoder {
142   static struct lc3_decoder* return_value;
143   std::function<struct lc3_decoder*(int dt_us, int sr_hz, int sr_pcm_hz,
144                                     void* mem)>
145       body{[](int dt_us, int sr_hz, int sr_pcm_hz, void* mem) {
146         return return_value;
147       }};
operatorlc3_setup_decoder148   struct lc3_decoder* operator()(int dt_us, int sr_hz, int sr_pcm_hz,
149                                  void* mem) {
150     return body(dt_us, sr_hz, sr_pcm_hz, mem);
151   };
152 };
153 extern struct lc3_setup_decoder lc3_setup_decoder;
154 
155 // Name: lc3_setup_encoder
156 // Params: int dt_us, int sr_hz, int sr_pcm_hz, void* mem
157 // Return: struct lc3_encoder*
158 struct lc3_setup_encoder {
159   static struct lc3_encoder* return_value;
160   std::function<struct lc3_encoder*(int dt_us, int sr_hz, int sr_pcm_hz,
161                                     void* mem)>
162       body{[](int dt_us, int sr_hz, int sr_pcm_hz, void* mem) {
163         return return_value;
164       }};
operatorlc3_setup_encoder165   struct lc3_encoder* operator()(int dt_us, int sr_hz, int sr_pcm_hz,
166                                  void* mem) {
167     return body(dt_us, sr_hz, sr_pcm_hz, mem);
168   };
169 };
170 extern struct lc3_setup_encoder lc3_setup_encoder;
171 
172 }  // namespace embdrv_lc3
173 }  // namespace mock
174 }  // namespace test
175 
176 // END mockcify generation
177