• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.3.0
22  */
23 
24 #include <cstdint>
25 #include <functional>
26 #include <map>
27 #include <string>
28 
29 // Original included files, if any
30 // NOTE: Since this is a mock file with mock definitions some number of
31 //       include files may not be required.  The include-what-you-use
32 //       still applies, but crafting proper inclusion is out of scope
33 //       for this effort.  This compilation unit may compile as-is, or
34 //       may need attention to prune from (or add to ) the inclusion set.
35 #include <base/logging.h>
36 #include <string.h>
37 
38 #include <mutex>
39 
40 #include "check.h"
41 #include "osi/include/allocator.h"
42 #include "osi/include/fixed_queue.h"
43 #include "osi/include/list.h"
44 #include "osi/include/osi.h"
45 #include "osi/include/reactor.h"
46 #include "test/common/mock_functions.h"
47 
48 // Mocked compile conditionals, if any
49 
50 namespace test {
51 namespace mock {
52 namespace osi_fixed_queue {
53 
54 // Shared state between mocked functions and tests
55 // Name: fixed_queue_capacity
56 // Params: fixed_queue_t* queue
57 // Return: size_t
58 struct fixed_queue_capacity {
59   size_t return_value{0};
60   std::function<size_t(fixed_queue_t* queue)> body{
61       [this](fixed_queue_t* queue) { return return_value; }};
operatorfixed_queue_capacity62   size_t operator()(fixed_queue_t* queue) { return body(queue); };
63 };
64 extern struct fixed_queue_capacity fixed_queue_capacity;
65 
66 // Name: fixed_queue_dequeue
67 // Params: fixed_queue_t* queue
68 // Return: void*
69 struct fixed_queue_dequeue {
70   void* return_value{};
71   std::function<void*(fixed_queue_t* queue)> body{
72       [this](fixed_queue_t* queue) { return return_value; }};
operatorfixed_queue_dequeue73   void* operator()(fixed_queue_t* queue) { return body(queue); };
74 };
75 extern struct fixed_queue_dequeue fixed_queue_dequeue;
76 
77 // Name: fixed_queue_enqueue
78 // Params: fixed_queue_t* queue, void* data
79 // Return: void
80 struct fixed_queue_enqueue {
81   std::function<void(fixed_queue_t* queue, void* data)> body{
82       [](fixed_queue_t* queue, void* data) {}};
operatorfixed_queue_enqueue83   void operator()(fixed_queue_t* queue, void* data) { body(queue, data); };
84 };
85 extern struct fixed_queue_enqueue fixed_queue_enqueue;
86 
87 // Name: fixed_queue_flush
88 // Params: fixed_queue_t* queue, fixed_queue_free_cb free_cb
89 // Return: void
90 struct fixed_queue_flush {
91   std::function<void(fixed_queue_t* queue, fixed_queue_free_cb free_cb)> body{
92       [](fixed_queue_t* queue, fixed_queue_free_cb free_cb) {}};
operatorfixed_queue_flush93   void operator()(fixed_queue_t* queue, fixed_queue_free_cb free_cb) {
94     body(queue, free_cb);
95   };
96 };
97 extern struct fixed_queue_flush fixed_queue_flush;
98 
99 // Name: fixed_queue_free
100 // Params: fixed_queue_t* queue, fixed_queue_free_cb free_cb
101 // Return: void
102 struct fixed_queue_free {
103   std::function<void(fixed_queue_t* queue, fixed_queue_free_cb free_cb)> body{
104       [](fixed_queue_t* queue, fixed_queue_free_cb free_cb) {}};
operatorfixed_queue_free105   void operator()(fixed_queue_t* queue, fixed_queue_free_cb free_cb) {
106     body(queue, free_cb);
107   };
108 };
109 extern struct fixed_queue_free fixed_queue_free;
110 
111 // Name: fixed_queue_get_dequeue_fd
112 // Params: const fixed_queue_t* queue
113 // Return: int
114 struct fixed_queue_get_dequeue_fd {
115   int return_value{0};
116   std::function<int(const fixed_queue_t* queue)> body{
117       [this](const fixed_queue_t* queue) { return return_value; }};
operatorfixed_queue_get_dequeue_fd118   int operator()(const fixed_queue_t* queue) { return body(queue); };
119 };
120 extern struct fixed_queue_get_dequeue_fd fixed_queue_get_dequeue_fd;
121 
122 // Name: fixed_queue_get_enqueue_fd
123 // Params: const fixed_queue_t* queue
124 // Return: int
125 struct fixed_queue_get_enqueue_fd {
126   int return_value{0};
127   std::function<int(const fixed_queue_t* queue)> body{
128       [this](const fixed_queue_t* queue) { return return_value; }};
operatorfixed_queue_get_enqueue_fd129   int operator()(const fixed_queue_t* queue) { return body(queue); };
130 };
131 extern struct fixed_queue_get_enqueue_fd fixed_queue_get_enqueue_fd;
132 
133 // Name: fixed_queue_get_list
134 // Params: fixed_queue_t* queue
135 // Return: list_t*
136 struct fixed_queue_get_list {
137   list_t* return_value{0};
138   std::function<list_t*(fixed_queue_t* queue)> body{
139       [this](fixed_queue_t* queue) { return return_value; }};
operatorfixed_queue_get_list140   list_t* operator()(fixed_queue_t* queue) { return body(queue); };
141 };
142 extern struct fixed_queue_get_list fixed_queue_get_list;
143 
144 // Name: fixed_queue_is_empty
145 // Params: fixed_queue_t* queue
146 // Return: bool
147 struct fixed_queue_is_empty {
148   bool return_value{false};
149   std::function<bool(fixed_queue_t* queue)> body{
150       [this](fixed_queue_t* queue) { return return_value; }};
operatorfixed_queue_is_empty151   bool operator()(fixed_queue_t* queue) { return body(queue); };
152 };
153 extern struct fixed_queue_is_empty fixed_queue_is_empty;
154 
155 // Name: fixed_queue_length
156 // Params: fixed_queue_t* queue
157 // Return: size_t
158 struct fixed_queue_length {
159   size_t return_value{0};
160   std::function<size_t(fixed_queue_t* queue)> body{
161       [this](fixed_queue_t* queue) { return return_value; }};
operatorfixed_queue_length162   size_t operator()(fixed_queue_t* queue) { return body(queue); };
163 };
164 extern struct fixed_queue_length fixed_queue_length;
165 
166 // Name: fixed_queue_new
167 // Params: size_t capacity
168 // Return: fixed_queue_t*
169 struct fixed_queue_new {
170   fixed_queue_t* return_value{0};
171   std::function<fixed_queue_t*(size_t capacity)> body{
172       [this](size_t capacity) { return return_value; }};
operatorfixed_queue_new173   fixed_queue_t* operator()(size_t capacity) { return body(capacity); };
174 };
175 extern struct fixed_queue_new fixed_queue_new;
176 
177 // Name: fixed_queue_register_dequeue
178 // Params: fixed_queue_t* queue, reactor_t* reactor, fixed_queue_cb ready_cb,
179 // void* context Return: void
180 struct fixed_queue_register_dequeue {
181   std::function<void(fixed_queue_t* queue, reactor_t* reactor,
182                      fixed_queue_cb ready_cb, void* context)>
183       body{[](fixed_queue_t* queue, reactor_t* reactor, fixed_queue_cb ready_cb,
184               void* context) {}};
operatorfixed_queue_register_dequeue185   void operator()(fixed_queue_t* queue, reactor_t* reactor,
186                   fixed_queue_cb ready_cb, void* context) {
187     body(queue, reactor, ready_cb, context);
188   };
189 };
190 extern struct fixed_queue_register_dequeue fixed_queue_register_dequeue;
191 
192 // Name: fixed_queue_try_dequeue
193 // Params: fixed_queue_t* queue
194 // Return: void*
195 struct fixed_queue_try_dequeue {
196   void* return_value{};
197   std::function<void*(fixed_queue_t* queue)> body{
198       [this](fixed_queue_t* queue) { return return_value; }};
operatorfixed_queue_try_dequeue199   void* operator()(fixed_queue_t* queue) { return body(queue); };
200 };
201 extern struct fixed_queue_try_dequeue fixed_queue_try_dequeue;
202 
203 // Name: fixed_queue_try_enqueue
204 // Params: fixed_queue_t* queue, void* data
205 // Return: bool
206 struct fixed_queue_try_enqueue {
207   bool return_value{false};
208   std::function<bool(fixed_queue_t* queue, void* data)> body{
209       [this](fixed_queue_t* queue, void* data) { return return_value; }};
operatorfixed_queue_try_enqueue210   bool operator()(fixed_queue_t* queue, void* data) {
211     return body(queue, data);
212   };
213 };
214 extern struct fixed_queue_try_enqueue fixed_queue_try_enqueue;
215 
216 // Name: fixed_queue_try_peek_first
217 // Params: fixed_queue_t* queue
218 // Return: void*
219 struct fixed_queue_try_peek_first {
220   void* return_value{};
221   std::function<void*(fixed_queue_t* queue)> body{
222       [this](fixed_queue_t* queue) { return return_value; }};
operatorfixed_queue_try_peek_first223   void* operator()(fixed_queue_t* queue) { return body(queue); };
224 };
225 extern struct fixed_queue_try_peek_first fixed_queue_try_peek_first;
226 
227 // Name: fixed_queue_try_peek_last
228 // Params: fixed_queue_t* queue
229 // Return: void*
230 struct fixed_queue_try_peek_last {
231   void* return_value{};
232   std::function<void*(fixed_queue_t* queue)> body{
233       [this](fixed_queue_t* queue) { return return_value; }};
operatorfixed_queue_try_peek_last234   void* operator()(fixed_queue_t* queue) { return body(queue); };
235 };
236 extern struct fixed_queue_try_peek_last fixed_queue_try_peek_last;
237 
238 // Name: fixed_queue_try_remove_from_queue
239 // Params: fixed_queue_t* queue, void* data
240 // Return: void*
241 struct fixed_queue_try_remove_from_queue {
242   void* return_value{};
243   std::function<void*(fixed_queue_t* queue, void* data)> body{
244       [this](fixed_queue_t* queue, void* data) { return return_value; }};
operatorfixed_queue_try_remove_from_queue245   void* operator()(fixed_queue_t* queue, void* data) {
246     return body(queue, data);
247   };
248 };
249 extern struct fixed_queue_try_remove_from_queue
250     fixed_queue_try_remove_from_queue;
251 
252 // Name: fixed_queue_unregister_dequeue
253 // Params: fixed_queue_t* queue
254 // Return: void
255 struct fixed_queue_unregister_dequeue {
256   std::function<void(fixed_queue_t* queue)> body{[](fixed_queue_t* queue) {}};
operatorfixed_queue_unregister_dequeue257   void operator()(fixed_queue_t* queue) { body(queue); };
258 };
259 extern struct fixed_queue_unregister_dequeue fixed_queue_unregister_dequeue;
260 
261 }  // namespace osi_fixed_queue
262 }  // namespace mock
263 }  // namespace test
264 
265 // END mockcify generation