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, enum lc3_pcm_format fmt, 46 void* pcm, int stride) { return return_value; }}; operatorlc3_decode47 int operator()(struct lc3_decoder* decoder, const void* in, int nbytes, enum lc3_pcm_format fmt, 48 void* pcm, int stride) { 49 return body(decoder, in, nbytes, fmt, pcm, stride); 50 } 51 }; 52 extern struct lc3_decode lc3_decode; 53 54 // Name: lc3_decoder_size 55 // Params: int dt_us, int sr_hz 56 // Return: unsigned 57 struct lc3_decoder_size { 58 static unsigned return_value; 59 std::function<unsigned(int dt_us, int sr_hz)> body{ 60 [](int dt_us, int sr_hz) { return return_value; }}; operatorlc3_decoder_size61 unsigned operator()(int dt_us, int sr_hz) { return body(dt_us, sr_hz); } 62 }; 63 extern struct lc3_decoder_size lc3_decoder_size; 64 65 // Name: lc3_delay_samples 66 // Params: int dt_us, int sr_hz 67 // Return: int 68 struct lc3_delay_samples { 69 static int return_value; 70 std::function<int(int dt_us, int sr_hz)> body{[](int dt_us, int sr_hz) { return return_value; }}; operatorlc3_delay_samples71 int operator()(int dt_us, int sr_hz) { return body(dt_us, sr_hz); } 72 }; 73 extern struct lc3_delay_samples lc3_delay_samples; 74 75 // Name: lc3_encode 76 // Params: struct lc3_encoder* encoder, enum lc3_pcm_format fmt, const void* 77 // pcm, int stride, int nbytes, void* out Return: int 78 struct lc3_encode { 79 static int return_value; 80 std::function<int(struct lc3_encoder* encoder, enum lc3_pcm_format fmt, const void* pcm, 81 int stride, int nbytes, void* out)> 82 body{[](struct lc3_encoder* encoder, enum lc3_pcm_format fmt, const void* pcm, int stride, 83 int nbytes, void* out) { return return_value; }}; operatorlc3_encode84 int operator()(struct lc3_encoder* encoder, enum lc3_pcm_format fmt, const void* pcm, int stride, 85 int nbytes, void* out) { 86 return body(encoder, fmt, pcm, stride, nbytes, out); 87 } 88 }; 89 extern struct lc3_encode lc3_encode; 90 91 // Name: lc3_encoder_size 92 // Params: int dt_us, int sr_hz 93 // Return: unsigned 94 struct lc3_encoder_size { 95 static unsigned return_value; 96 std::function<unsigned(int dt_us, int sr_hz)> body{ 97 [](int dt_us, int sr_hz) { return return_value; }}; operatorlc3_encoder_size98 unsigned operator()(int dt_us, int sr_hz) { return body(dt_us, sr_hz); } 99 }; 100 extern struct lc3_encoder_size lc3_encoder_size; 101 102 // Name: lc3_frame_bytes 103 // Params: int dt_us, int bitrate 104 // Return: int 105 struct lc3_frame_bytes { 106 static int return_value; 107 std::function<int(int dt_us, int bitrate)> body{ 108 [](int dt_us, int bitrate) { return return_value; }}; operatorlc3_frame_bytes109 int operator()(int dt_us, int bitrate) { return body(dt_us, bitrate); } 110 }; 111 extern struct lc3_frame_bytes lc3_frame_bytes; 112 113 // Name: lc3_frame_samples 114 // Params: int dt_us, int sr_hz 115 // Return: int 116 struct lc3_frame_samples { 117 static int return_value; 118 std::function<int(int dt_us, int sr_hz)> body{[](int dt_us, int sr_hz) { return return_value; }}; operatorlc3_frame_samples119 int operator()(int dt_us, int sr_hz) { return body(dt_us, sr_hz); } 120 }; 121 extern struct lc3_frame_samples lc3_frame_samples; 122 123 // Name: lc3_resolve_bitrate 124 // Params: int dt_us, int nbytes 125 // Return: int 126 struct lc3_resolve_bitrate { 127 static int return_value; 128 std::function<int(int dt_us, int nbytes)> body{ 129 [](int dt_us, int nbytes) { return return_value; }}; operatorlc3_resolve_bitrate130 int operator()(int dt_us, int nbytes) { return body(dt_us, nbytes); } 131 }; 132 extern struct lc3_resolve_bitrate lc3_resolve_bitrate; 133 134 // Name: lc3_setup_decoder 135 // Params: int dt_us, int sr_hz, int sr_pcm_hz, void* mem 136 // Return: struct lc3_decoder* 137 struct lc3_setup_decoder { 138 static struct lc3_decoder* return_value; 139 std::function<struct lc3_decoder*(int dt_us, int sr_hz, int sr_pcm_hz, void* mem)> body{ 140 [](int dt_us, int sr_hz, int sr_pcm_hz, void* mem) { return return_value; }}; operatorlc3_setup_decoder141 struct lc3_decoder* operator()(int dt_us, int sr_hz, int sr_pcm_hz, void* mem) { 142 return body(dt_us, sr_hz, sr_pcm_hz, mem); 143 } 144 }; 145 extern struct lc3_setup_decoder lc3_setup_decoder; 146 147 // Name: lc3_setup_encoder 148 // Params: int dt_us, int sr_hz, int sr_pcm_hz, void* mem 149 // Return: struct lc3_encoder* 150 struct lc3_setup_encoder { 151 static struct lc3_encoder* return_value; 152 std::function<struct lc3_encoder*(int dt_us, int sr_hz, int sr_pcm_hz, void* mem)> body{ 153 [](int dt_us, int sr_hz, int sr_pcm_hz, void* mem) { return return_value; }}; operatorlc3_setup_encoder154 struct lc3_encoder* operator()(int dt_us, int sr_hz, int sr_pcm_hz, void* mem) { 155 return body(dt_us, sr_hz, sr_pcm_hz, mem); 156 } 157 }; 158 extern struct lc3_setup_encoder lc3_setup_encoder; 159 160 } // namespace embdrv_lc3 161 } // namespace mock 162 } // namespace test 163 164 // END mockcify generation 165