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