• 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  */
20 
21 #include <sys/socket.h>
22 
23 #include <list>
24 #include <map>
25 #include <string>
26 
27 extern std::map<std::string, int> mock_function_count_map;
28 
29 #include "osi/src/compat.cc"  // For strlcpy
30 
31 #include "osi/include/alarm.h"
32 #include "osi/include/allocator.h"
33 #include "osi/include/array.h"
34 #include "osi/include/buffer.h"
35 #include "osi/include/config.h"
36 #include "osi/include/fixed_queue.h"
37 #include "osi/include/future.h"
38 #include "osi/include/hash_map_utils.h"
39 #include "osi/include/list.h"
40 #include "osi/include/log.h"
41 #include "osi/include/osi.h"
42 #include "osi/include/reactor.h"
43 #include "osi/include/ringbuffer.h"
44 #include "osi/include/semaphore.h"
45 #include "osi/include/socket.h"
46 #include "osi/include/thread.h"
47 #include "osi/include/wakelock.h"
48 #include "test/common/fake_osi.h"
49 
50 #ifndef UNUSED_ATTR
51 #define UNUSED_ATTR
52 #endif
53 
54 struct StringComparison {
operator ()StringComparison55   bool operator()(char const* lhs, char const* rhs) const {
56     return strcmp(lhs, rhs) < 0;
57   }
58 };
59 std::map<const char*, bool, StringComparison> fake_osi_bool_props_map;
60 
Find(const std::string & key)61 std::list<entry_t>::iterator section_t::Find(const std::string& key) {
62   mock_function_count_map[__func__]++;
63   return std::find_if(
64       entries.begin(), entries.end(),
65       [&key](const entry_t& entry) { return entry.key == key; });
66 }
Find(const std::string & section)67 std::list<section_t>::iterator config_t::Find(const std::string& section) {
68   mock_function_count_map[__func__]++;
69   return std::find_if(
70       sections.begin(), sections.end(),
71       [&section](const section_t& sec) { return sec.name == section; });
72 }
73 
checksum_save(const std::string & checksum,const std::string & filename)74 bool checksum_save(const std::string& checksum, const std::string& filename) {
75   mock_function_count_map[__func__]++;
76   return false;
77 }
config_get_bool(const config_t & config,const std::string & section,const std::string & key,bool def_value)78 bool config_get_bool(const config_t& config, const std::string& section,
79                      const std::string& key, bool def_value) {
80   mock_function_count_map[__func__]++;
81   return false;
82 }
config_has_key(const config_t & config,const std::string & section,const std::string & key)83 bool config_has_key(const config_t& config, const std::string& section,
84                     const std::string& key) {
85   mock_function_count_map[__func__]++;
86   return false;
87 }
config_has_section(const config_t & config,const std::string & section)88 bool config_has_section(const config_t& config, const std::string& section) {
89   mock_function_count_map[__func__]++;
90   return false;
91 }
config_remove_key(config_t * config,const std::string & section,const std::string & key)92 bool config_remove_key(config_t* config, const std::string& section,
93                        const std::string& key) {
94   mock_function_count_map[__func__]++;
95   return false;
96 }
config_remove_section(config_t * config,const std::string & section)97 bool config_remove_section(config_t* config, const std::string& section) {
98   mock_function_count_map[__func__]++;
99   return false;
100 }
config_save(const config_t & config,const std::string & filename)101 bool config_save(const config_t& config, const std::string& filename) {
102   mock_function_count_map[__func__]++;
103   return false;
104 }
Has(const std::string & key)105 bool config_t::Has(const std::string& key) {
106   mock_function_count_map[__func__]++;
107   return false;
108 }
Has(const std::string & key)109 bool section_t::Has(const std::string& key) {
110   mock_function_count_map[__func__]++;
111   return false;
112 }
config_get_string(const config_t & config,const std::string & section,const std::string & key,const std::string * def_value)113 const std::string* config_get_string(const config_t& config,
114                                      const std::string& section,
115                                      const std::string& key,
116                                      const std::string* def_value) {
117   mock_function_count_map[__func__]++;
118   return nullptr;
119 }
config_get_int(const config_t & config,const std::string & section,const std::string & key,int def_value)120 int config_get_int(const config_t& config, const std::string& section,
121                    const std::string& key, int def_value) {
122   mock_function_count_map[__func__]++;
123   return 0;
124 }
checksum_read(const char * filename)125 std::string checksum_read(const char* filename) {
126   mock_function_count_map[__func__]++;
127   return 0;
128 }
config_new(const char * filename)129 std::unique_ptr<config_t> config_new(const char* filename) {
130   mock_function_count_map[__func__]++;
131   return 0;
132 }
config_new_clone(const config_t & src)133 std::unique_ptr<config_t> config_new_clone(const config_t& src) {
134   mock_function_count_map[__func__]++;
135   return 0;
136 }
config_new_empty(void)137 std::unique_ptr<config_t> config_new_empty(void) {
138   mock_function_count_map[__func__]++;
139   return 0;
140 }
config_get_uint64(const config_t & config,const std::string & section,const std::string & key,uint64_t def_value)141 uint64_t config_get_uint64(const config_t& config, const std::string& section,
142                            const std::string& key, uint64_t def_value) {
143   mock_function_count_map[__func__]++;
144   return 0;
145 }
config_set_bool(config_t * config,const std::string & section,const std::string & key,bool value)146 void config_set_bool(config_t* config, const std::string& section,
147                      const std::string& key, bool value) {
148   mock_function_count_map[__func__]++;
149 }
config_set_int(config_t * config,const std::string & section,const std::string & key,int value)150 void config_set_int(config_t* config, const std::string& section,
151                     const std::string& key, int value) {
152   mock_function_count_map[__func__]++;
153 }
config_set_string(config_t * config,const std::string & section,const std::string & key,const std::string & value)154 void config_set_string(config_t* config, const std::string& section,
155                        const std::string& key, const std::string& value) {
156   mock_function_count_map[__func__]++;
157 }
config_set_uint64(config_t * config,const std::string & section,const std::string & key,uint64_t value)158 void config_set_uint64(config_t* config, const std::string& section,
159                        const std::string& key, uint64_t value) {
160   mock_function_count_map[__func__]++;
161 }
Set(std::string key,std::string value)162 void section_t::Set(std::string key, std::string value) {
163   mock_function_count_map[__func__]++;
164 }
165 
array_append_ptr(array_t * array,void * data)166 bool array_append_ptr(array_t* array, void* data) {
167   mock_function_count_map[__func__]++;
168   return false;
169 }
array_append_value(array_t * array,uint32_t value)170 bool array_append_value(array_t* array, uint32_t value) {
171   mock_function_count_map[__func__]++;
172   return false;
173 }
array_length(const array_t * array)174 size_t array_length(const array_t* array) {
175   mock_function_count_map[__func__]++;
176   return 0;
177 }
array_free(array_t * array)178 void array_free(array_t* array) { mock_function_count_map[__func__]++; }
array_at(const array_t * array,size_t index)179 void* array_at(const array_t* array, size_t index) {
180   mock_function_count_map[__func__]++;
181   return nullptr;
182 }
array_ptr(const array_t * array)183 void* array_ptr(const array_t* array) {
184   mock_function_count_map[__func__]++;
185   return nullptr;
186 }
187 
allocation_tracker_expect_no_allocations(void)188 size_t allocation_tracker_expect_no_allocations(void) {
189   mock_function_count_map[__func__]++;
190   return 0;
191 }
allocation_tracker_resize_for_canary(size_t size)192 size_t allocation_tracker_resize_for_canary(size_t size) {
193   mock_function_count_map[__func__]++;
194   return 0;
195 }
allocation_tracker_reset(void)196 void allocation_tracker_reset(void) { mock_function_count_map[__func__]++; }
allocation_tracker_uninit(void)197 void allocation_tracker_uninit(void) { mock_function_count_map[__func__]++; }
osi_allocator_debug_dump(int fd)198 void osi_allocator_debug_dump(int fd) { mock_function_count_map[__func__]++; }
allocation_tracker_notify_alloc(uint8_t allocator_id,void * ptr,size_t requested_size)199 void* allocation_tracker_notify_alloc(uint8_t allocator_id, void* ptr,
200                                       size_t requested_size) {
201   mock_function_count_map[__func__]++;
202   return nullptr;
203 }
allocation_tracker_notify_free(UNUSED_ATTR uint8_t allocator_id,void * ptr)204 void* allocation_tracker_notify_free(UNUSED_ATTR uint8_t allocator_id,
205                                      void* ptr) {
206   mock_function_count_map[__func__]++;
207   return nullptr;
208 }
209 
reactor_change_registration(reactor_object_t * object,void (* read_ready)(void * context),void (* write_ready)(void * context))210 bool reactor_change_registration(reactor_object_t* object,
211                                  void (*read_ready)(void* context),
212                                  void (*write_ready)(void* context)) {
213   mock_function_count_map[__func__]++;
214   return false;
215 }
reactor_register(reactor_t * reactor,int fd,void * context,void (* read_ready)(void * context),void (* write_ready)(void * context))216 reactor_object_t* reactor_register(reactor_t* reactor, int fd, void* context,
217                                    void (*read_ready)(void* context),
218                                    void (*write_ready)(void* context)) {
219   mock_function_count_map[__func__]++;
220   return nullptr;
221 }
reactor_run_once(reactor_t * reactor)222 reactor_status_t reactor_run_once(reactor_t* reactor) {
223   mock_function_count_map[__func__]++;
224   return REACTOR_STATUS_DONE;
225 }
reactor_start(reactor_t * reactor)226 reactor_status_t reactor_start(reactor_t* reactor) {
227   mock_function_count_map[__func__]++;
228   return REACTOR_STATUS_DONE;
229 }
reactor_new(void)230 reactor_t* reactor_new(void) {
231   mock_function_count_map[__func__]++;
232   return nullptr;
233 }
reactor_free(reactor_t * reactor)234 void reactor_free(reactor_t* reactor) { mock_function_count_map[__func__]++; }
reactor_stop(reactor_t * reactor)235 void reactor_stop(reactor_t* reactor) { mock_function_count_map[__func__]++; }
reactor_unregister(reactor_object_t * obj)236 void reactor_unregister(reactor_object_t* obj) {
237   mock_function_count_map[__func__]++;
238 }
239 
future_new(void)240 future_t* future_new(void) {
241   mock_function_count_map[__func__]++;
242   return nullptr;
243 }
future_new_immediate(void * value)244 future_t* future_new_immediate(void* value) {
245   mock_function_count_map[__func__]++;
246   return nullptr;
247 }
future_ready(future_t * future,void * value)248 void future_ready(future_t* future, void* value) {
249   mock_function_count_map[__func__]++;
250 }
mutex_global_lock(void)251 void mutex_global_lock(void) { mock_function_count_map[__func__]++; }
mutex_global_unlock(void)252 void mutex_global_unlock(void) { mock_function_count_map[__func__]++; }
future_await(future_t * future)253 void* future_await(future_t* future) {
254   mock_function_count_map[__func__]++;
255   return nullptr;
256 }
257 
thread_is_self(const thread_t * thread)258 bool thread_is_self(const thread_t* thread) {
259   mock_function_count_map[__func__]++;
260   return false;
261 }
thread_post(thread_t * thread,thread_fn func,void * context)262 bool thread_post(thread_t* thread, thread_fn func, void* context) {
263   mock_function_count_map[__func__]++;
264   return false;
265 }
thread_set_priority(thread_t * thread,int priority)266 bool thread_set_priority(thread_t* thread, int priority) {
267   mock_function_count_map[__func__]++;
268   return false;
269 }
thread_set_rt_priority(thread_t * thread,int priority)270 bool thread_set_rt_priority(thread_t* thread, int priority) {
271   mock_function_count_map[__func__]++;
272   return false;
273 }
thread_name(const thread_t * thread)274 const char* thread_name(const thread_t* thread) {
275   mock_function_count_map[__func__]++;
276   return nullptr;
277 }
thread_get_reactor(const thread_t * thread)278 reactor_t* thread_get_reactor(const thread_t* thread) {
279   mock_function_count_map[__func__]++;
280   return nullptr;
281 }
thread_new(const char * name)282 thread_t* thread_new(const char* name) {
283   mock_function_count_map[__func__]++;
284   return nullptr;
285 }
thread_new_sized(const char * name,size_t work_queue_capacity)286 thread_t* thread_new_sized(const char* name, size_t work_queue_capacity) {
287   mock_function_count_map[__func__]++;
288   return nullptr;
289 }
thread_free(thread_t * thread)290 void thread_free(thread_t* thread) { mock_function_count_map[__func__]++; }
thread_join(thread_t * thread)291 void thread_join(thread_t* thread) { mock_function_count_map[__func__]++; }
thread_stop(thread_t * thread)292 void thread_stop(thread_t* thread) { mock_function_count_map[__func__]++; }
293 
osi_strdup(const char * str)294 char* osi_strdup(const char* str) {
295   mock_function_count_map[__func__]++;
296   return nullptr;
297 }
osi_strndup(const char * str,size_t len)298 char* osi_strndup(const char* str, size_t len) {
299   mock_function_count_map[__func__]++;
300   return nullptr;
301 }
osi_free(void * ptr)302 void osi_free(void* ptr) { mock_function_count_map[__func__]++; }
osi_free_and_reset(void ** p_ptr)303 void osi_free_and_reset(void** p_ptr) { mock_function_count_map[__func__]++; }
osi_calloc(size_t size)304 void* osi_calloc(size_t size) {
305   mock_function_count_map[__func__]++;
306   return nullptr;
307 }
osi_malloc(size_t size)308 void* osi_malloc(size_t size) {
309   mock_function_count_map[__func__]++;
310   return nullptr;
311 }
312 
fixed_queue_is_empty(fixed_queue_t * queue)313 bool fixed_queue_is_empty(fixed_queue_t* queue) {
314   mock_function_count_map[__func__]++;
315   return false;
316 }
fixed_queue_try_enqueue(fixed_queue_t * queue,void * data)317 bool fixed_queue_try_enqueue(fixed_queue_t* queue, void* data) {
318   mock_function_count_map[__func__]++;
319   return false;
320 }
fixed_queue_new(size_t capacity)321 fixed_queue_t* fixed_queue_new(size_t capacity) {
322   mock_function_count_map[__func__]++;
323   return nullptr;
324 }
fixed_queue_get_dequeue_fd(const fixed_queue_t * queue)325 int fixed_queue_get_dequeue_fd(const fixed_queue_t* queue) {
326   mock_function_count_map[__func__]++;
327   return 0;
328 }
fixed_queue_get_enqueue_fd(const fixed_queue_t * queue)329 int fixed_queue_get_enqueue_fd(const fixed_queue_t* queue) {
330   mock_function_count_map[__func__]++;
331   return 0;
332 }
fixed_queue_get_list(fixed_queue_t * queue)333 list_t* fixed_queue_get_list(fixed_queue_t* queue) {
334   mock_function_count_map[__func__]++;
335   return nullptr;
336 }
fixed_queue_capacity(fixed_queue_t * queue)337 size_t fixed_queue_capacity(fixed_queue_t* queue) {
338   mock_function_count_map[__func__]++;
339   return 0;
340 }
fixed_queue_length(fixed_queue_t * queue)341 size_t fixed_queue_length(fixed_queue_t* queue) {
342   mock_function_count_map[__func__]++;
343   return 0;
344 }
fixed_queue_enqueue(fixed_queue_t * queue,void * data)345 void fixed_queue_enqueue(fixed_queue_t* queue, void* data) {
346   mock_function_count_map[__func__]++;
347 }
fixed_queue_flush(fixed_queue_t * queue,fixed_queue_free_cb free_cb)348 void fixed_queue_flush(fixed_queue_t* queue, fixed_queue_free_cb free_cb) {
349   mock_function_count_map[__func__]++;
350 }
fixed_queue_free(fixed_queue_t * queue,fixed_queue_free_cb free_cb)351 void fixed_queue_free(fixed_queue_t* queue, fixed_queue_free_cb free_cb) {
352   mock_function_count_map[__func__]++;
353 }
fixed_queue_register_dequeue(fixed_queue_t * queue,reactor_t * reactor,fixed_queue_cb ready_cb,void * context)354 void fixed_queue_register_dequeue(fixed_queue_t* queue, reactor_t* reactor,
355                                   fixed_queue_cb ready_cb, void* context) {
356   mock_function_count_map[__func__]++;
357 }
fixed_queue_unregister_dequeue(fixed_queue_t * queue)358 void fixed_queue_unregister_dequeue(fixed_queue_t* queue) {
359   mock_function_count_map[__func__]++;
360 }
fixed_queue_dequeue(fixed_queue_t * queue)361 void* fixed_queue_dequeue(fixed_queue_t* queue) {
362   mock_function_count_map[__func__]++;
363   return nullptr;
364 }
fixed_queue_try_dequeue(fixed_queue_t * queue)365 void* fixed_queue_try_dequeue(fixed_queue_t* queue) {
366   mock_function_count_map[__func__]++;
367   return nullptr;
368 }
fixed_queue_try_peek_first(fixed_queue_t * queue)369 void* fixed_queue_try_peek_first(fixed_queue_t* queue) {
370   mock_function_count_map[__func__]++;
371   return nullptr;
372 }
fixed_queue_try_peek_last(fixed_queue_t * queue)373 void* fixed_queue_try_peek_last(fixed_queue_t* queue) {
374   mock_function_count_map[__func__]++;
375   return nullptr;
376 }
fixed_queue_try_remove_from_queue(fixed_queue_t * queue,void * data)377 void* fixed_queue_try_remove_from_queue(fixed_queue_t* queue, void* data) {
378   mock_function_count_map[__func__]++;
379   return nullptr;
380 }
381 
alarm_new(const char * name)382 alarm_t* alarm_new(const char* name) {
383   mock_function_count_map[__func__]++;
384   return (alarm_t*)new uint8_t[30];
385 }
alarm_new_periodic(const char * name)386 alarm_t* alarm_new_periodic(const char* name) {
387   mock_function_count_map[__func__]++;
388   return nullptr;
389 }
390 struct fake_osi_alarm_set_on_mloop fake_osi_alarm_set_on_mloop_;
alarm_is_scheduled(const alarm_t * alarm)391 bool alarm_is_scheduled(const alarm_t* alarm) {
392   mock_function_count_map[__func__]++;
393   return (fake_osi_alarm_set_on_mloop_.cb != nullptr);
394 }
alarm_get_remaining_ms(const alarm_t * alarm)395 uint64_t alarm_get_remaining_ms(const alarm_t* alarm) {
396   mock_function_count_map[__func__]++;
397   return 0;
398 }
alarm_cancel(alarm_t * alarm)399 void alarm_cancel(alarm_t* alarm) {
400   mock_function_count_map[__func__]++;
401   fake_osi_alarm_set_on_mloop_.interval_ms = 0;
402   fake_osi_alarm_set_on_mloop_.cb = nullptr;
403   fake_osi_alarm_set_on_mloop_.data = nullptr;
404 }
alarm_cleanup(void)405 void alarm_cleanup(void) { mock_function_count_map[__func__]++; }
alarm_debug_dump(int fd)406 void alarm_debug_dump(int fd) { mock_function_count_map[__func__]++; }
alarm_free(alarm_t * alarm)407 void alarm_free(alarm_t* alarm) {
408   uint8_t* ptr = (uint8_t*)alarm;
409   delete[] ptr;
410   mock_function_count_map[__func__]++;
411 }
alarm_set(alarm_t * alarm,uint64_t interval_ms,alarm_callback_t cb,void * data)412 void alarm_set(alarm_t* alarm, uint64_t interval_ms, alarm_callback_t cb,
413                void* data) {
414   mock_function_count_map[__func__]++;
415 }
416 
alarm_set_on_mloop(alarm_t * alarm,uint64_t interval_ms,alarm_callback_t cb,void * data)417 void alarm_set_on_mloop(alarm_t* alarm, uint64_t interval_ms,
418                         alarm_callback_t cb, void* data) {
419   mock_function_count_map[__func__]++;
420   fake_osi_alarm_set_on_mloop_.interval_ms = interval_ms;
421   fake_osi_alarm_set_on_mloop_.cb = cb;
422   fake_osi_alarm_set_on_mloop_.data = data;
423 }
424 
osi_rand(void)425 int osi_rand(void) {
426   mock_function_count_map[__func__]++;
427   return 0;
428 }
429 
buffer_new_ref(const buffer_t * buf)430 buffer_t* buffer_new_ref(const buffer_t* buf) {
431   mock_function_count_map[__func__]++;
432   return nullptr;
433 }
buffer_new_slice(const buffer_t * buf,size_t slice_size)434 buffer_t* buffer_new_slice(const buffer_t* buf, size_t slice_size) {
435   mock_function_count_map[__func__]++;
436   return nullptr;
437 }
buffer_length(const buffer_t * buf)438 size_t buffer_length(const buffer_t* buf) {
439   mock_function_count_map[__func__]++;
440   return 0;
441 }
buffer_free(buffer_t * buffer)442 void buffer_free(buffer_t* buffer) { mock_function_count_map[__func__]++; }
buffer_ptr(const buffer_t * buf)443 void* buffer_ptr(const buffer_t* buf) {
444   mock_function_count_map[__func__]++;
445   return nullptr;
446 }
447 
socket_listen(const socket_t * socket,port_t port)448 bool socket_listen(const socket_t* socket, port_t port) {
449   mock_function_count_map[__func__]++;
450   return false;
451 }
socket_accept(const socket_t * socket)452 socket_t* socket_accept(const socket_t* socket) {
453   mock_function_count_map[__func__]++;
454   return nullptr;
455 }
socket_new(void)456 socket_t* socket_new(void) {
457   mock_function_count_map[__func__]++;
458   return nullptr;
459 }
socket_new_from_fd(int fd)460 socket_t* socket_new_from_fd(int fd) {
461   mock_function_count_map[__func__]++;
462   return nullptr;
463 }
socket_bytes_available(const socket_t * socket)464 ssize_t socket_bytes_available(const socket_t* socket) {
465   mock_function_count_map[__func__]++;
466   return 0;
467 }
socket_read(const socket_t * socket,void * buf,size_t count)468 ssize_t socket_read(const socket_t* socket, void* buf, size_t count) {
469   mock_function_count_map[__func__]++;
470   return 0;
471 }
socket_write(const socket_t * socket,const void * buf,size_t count)472 ssize_t socket_write(const socket_t* socket, const void* buf, size_t count) {
473   mock_function_count_map[__func__]++;
474   return 0;
475 }
socket_write_and_transfer_fd(const socket_t * socket,const void * buf,size_t count,int fd)476 ssize_t socket_write_and_transfer_fd(const socket_t* socket, const void* buf,
477                                      size_t count, int fd) {
478   mock_function_count_map[__func__]++;
479   return 0;
480 }
socket_free(socket_t * socket)481 void socket_free(socket_t* socket) { mock_function_count_map[__func__]++; }
socket_register(socket_t * socket,reactor_t * reactor,void * context,socket_cb read_cb,socket_cb write_cb)482 void socket_register(socket_t* socket, reactor_t* reactor, void* context,
483                      socket_cb read_cb, socket_cb write_cb) {
484   mock_function_count_map[__func__]++;
485 }
socket_unregister(socket_t * socket)486 void socket_unregister(socket_t* socket) {
487   mock_function_count_map[__func__]++;
488 }
489 
list_append(list_t * list,void * data)490 bool list_append(list_t* list, void* data) {
491   mock_function_count_map[__func__]++;
492   return false;
493 }
list_contains(const list_t * list,const void * data)494 bool list_contains(const list_t* list, const void* data) {
495   mock_function_count_map[__func__]++;
496   return false;
497 }
list_insert_after(list_t * list,list_node_t * prev_node,void * data)498 bool list_insert_after(list_t* list, list_node_t* prev_node, void* data) {
499   mock_function_count_map[__func__]++;
500   return false;
501 }
list_is_empty(const list_t * list)502 bool list_is_empty(const list_t* list) {
503   mock_function_count_map[__func__]++;
504   return false;
505 }
list_prepend(list_t * list,void * data)506 bool list_prepend(list_t* list, void* data) {
507   mock_function_count_map[__func__]++;
508   return false;
509 }
list_remove(list_t * list,void * data)510 bool list_remove(list_t* list, void* data) {
511   mock_function_count_map[__func__]++;
512   return false;
513 }
list_back_node(const list_t * list)514 list_node_t* list_back_node(const list_t* list) {
515   mock_function_count_map[__func__]++;
516   return nullptr;
517 }
list_begin(const list_t * list)518 list_node_t* list_begin(const list_t* list) {
519   mock_function_count_map[__func__]++;
520   return nullptr;
521 }
list_end(UNUSED_ATTR const list_t * list)522 list_node_t* list_end(UNUSED_ATTR const list_t* list) {
523   mock_function_count_map[__func__]++;
524   return nullptr;
525 }
list_foreach(const list_t * list,list_iter_cb callback,void * context)526 list_node_t* list_foreach(const list_t* list, list_iter_cb callback,
527                           void* context) {
528   mock_function_count_map[__func__]++;
529   return nullptr;
530 }
list_next(const list_node_t * node)531 list_node_t* list_next(const list_node_t* node) {
532   mock_function_count_map[__func__]++;
533   return nullptr;
534 }
list_new(list_free_cb callback)535 list_t* list_new(list_free_cb callback) {
536   mock_function_count_map[__func__]++;
537   return nullptr;
538 }
list_new_internal(list_free_cb callback,const allocator_t * zeroed_allocator)539 list_t* list_new_internal(list_free_cb callback,
540                           const allocator_t* zeroed_allocator) {
541   mock_function_count_map[__func__]++;
542   return nullptr;
543 }
list_length(const list_t * list)544 size_t list_length(const list_t* list) {
545   mock_function_count_map[__func__]++;
546   return 0;
547 }
list_clear(list_t * list)548 void list_clear(list_t* list) { mock_function_count_map[__func__]++; }
list_free(list_t * list)549 void list_free(list_t* list) { mock_function_count_map[__func__]++; }
list_back(const list_t * list)550 void* list_back(const list_t* list) {
551   mock_function_count_map[__func__]++;
552   return nullptr;
553 }
list_front(const list_t * list)554 void* list_front(const list_t* list) {
555   mock_function_count_map[__func__]++;
556   return nullptr;
557 }
list_node(const list_node_t * node)558 void* list_node(const list_node_t* node) {
559   mock_function_count_map[__func__]++;
560   return nullptr;
561 }
562 
osi_socket_local_client(const char * name,int namespaceId,int type)563 int osi_socket_local_client(const char* name, int namespaceId, int type) {
564   mock_function_count_map[__func__]++;
565   return 0;
566 }
osi_socket_local_client_connect(int fd,const char * name,int namespaceId,int type UNUSED_ATTR)567 int osi_socket_local_client_connect(int fd, const char* name, int namespaceId,
568                                     int type UNUSED_ATTR) {
569   mock_function_count_map[__func__]++;
570   return 0;
571 }
osi_socket_local_server_bind(int s,const char * name,int namespaceId)572 int osi_socket_local_server_bind(int s, const char* name, int namespaceId) {
573   mock_function_count_map[__func__]++;
574   return 0;
575 }
osi_socket_make_sockaddr_un(const char * name,int namespaceId,struct sockaddr_un * p_addr,socklen_t * alen)576 int osi_socket_make_sockaddr_un(const char* name, int namespaceId,
577                                 struct sockaddr_un* p_addr, socklen_t* alen) {
578   mock_function_count_map[__func__]++;
579   return 0;
580 }
581 
ringbuffer_available(const ringbuffer_t * rb)582 size_t ringbuffer_available(const ringbuffer_t* rb) {
583   mock_function_count_map[__func__]++;
584   return 0;
585 }
ringbuffer_delete(ringbuffer_t * rb,size_t length)586 size_t ringbuffer_delete(ringbuffer_t* rb, size_t length) {
587   mock_function_count_map[__func__]++;
588   return 0;
589 }
ringbuffer_insert(ringbuffer_t * rb,const uint8_t * p,size_t length)590 size_t ringbuffer_insert(ringbuffer_t* rb, const uint8_t* p, size_t length) {
591   mock_function_count_map[__func__]++;
592   return 0;
593 }
ringbuffer_peek(const ringbuffer_t * rb,off_t offset,uint8_t * p,size_t length)594 size_t ringbuffer_peek(const ringbuffer_t* rb, off_t offset, uint8_t* p,
595                        size_t length) {
596   mock_function_count_map[__func__]++;
597   return 0;
598 }
ringbuffer_pop(ringbuffer_t * rb,uint8_t * p,size_t length)599 size_t ringbuffer_pop(ringbuffer_t* rb, uint8_t* p, size_t length) {
600   mock_function_count_map[__func__]++;
601   return 0;
602 }
ringbuffer_size(const ringbuffer_t * rb)603 size_t ringbuffer_size(const ringbuffer_t* rb) {
604   mock_function_count_map[__func__]++;
605   return 0;
606 }
ringbuffer_free(ringbuffer_t * rb)607 void ringbuffer_free(ringbuffer_t* rb) { mock_function_count_map[__func__]++; }
608 
osi_property_get_bool(const char * key,bool default_value)609 bool osi_property_get_bool(const char* key, bool default_value) {
610   mock_function_count_map[__func__]++;
611   if (fake_osi_bool_props_map.count(key))
612     return fake_osi_bool_props_map.at(key);
613   return default_value;
614 }
615 
osi_property_set_bool(const char * key,bool value)616 void osi_property_set_bool(const char* key, bool value) {
617   fake_osi_bool_props_map.insert_or_assign(key, value);
618 }
619 
osi_property_get(const char * key,char * value,const char * default_value)620 int osi_property_get(const char* key, char* value, const char* default_value) {
621   mock_function_count_map[__func__]++;
622   return 0;
623 }
osi_property_set(const char * key,const char * value)624 int osi_property_set(const char* key, const char* value) {
625   mock_function_count_map[__func__]++;
626   return 0;
627 }
osi_property_get_int32(const char * key,int32_t default_value)628 int32_t osi_property_get_int32(const char* key, int32_t default_value) {
629   mock_function_count_map[__func__]++;
630   return 0;
631 }
632 
semaphore_try_wait(semaphore_t * semaphore)633 bool semaphore_try_wait(semaphore_t* semaphore) {
634   mock_function_count_map[__func__]++;
635   return false;
636 }
semaphore_get_fd(const semaphore_t * semaphore)637 int semaphore_get_fd(const semaphore_t* semaphore) {
638   mock_function_count_map[__func__]++;
639   return 0;
640 }
semaphore_new(unsigned int value)641 semaphore_t* semaphore_new(unsigned int value) {
642   mock_function_count_map[__func__]++;
643   return nullptr;
644 }
semaphore_free(semaphore_t * semaphore)645 void semaphore_free(semaphore_t* semaphore) {
646   mock_function_count_map[__func__]++;
647 }
semaphore_post(semaphore_t * semaphore)648 void semaphore_post(semaphore_t* semaphore) {
649   mock_function_count_map[__func__]++;
650 }
semaphore_wait(semaphore_t * semaphore)651 void semaphore_wait(semaphore_t* semaphore) {
652   mock_function_count_map[__func__]++;
653 }
654 
wakelock_acquire(void)655 bool wakelock_acquire(void) {
656   mock_function_count_map[__func__]++;
657   return false;
658 }
wakelock_release(void)659 bool wakelock_release(void) {
660   mock_function_count_map[__func__]++;
661   return false;
662 }
wakelock_cleanup(void)663 void wakelock_cleanup(void) { mock_function_count_map[__func__]++; }
wakelock_debug_dump(int fd)664 void wakelock_debug_dump(int fd) { mock_function_count_map[__func__]++; }
wakelock_set_os_callouts(bt_os_callouts_t * callouts)665 void wakelock_set_os_callouts(bt_os_callouts_t* callouts) {
666   mock_function_count_map[__func__]++;
667 }
wakelock_set_paths(const char * lock_path,const char * unlock_path)668 void wakelock_set_paths(const char* lock_path, const char* unlock_path) {
669   mock_function_count_map[__func__]++;
670 }
671