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 // Mock include file to share data between tests and mock
24 #include "test/mock/mock_osi_fixed_queue.h"
25 
26 #include "test/common/mock_functions.h"
27 
28 // Mocked internal structures, if any
29 
30 namespace test {
31 namespace mock {
32 namespace osi_fixed_queue {
33 
34 // Function state capture and return values, if needed
35 struct fixed_queue_capacity fixed_queue_capacity;
36 struct fixed_queue_dequeue fixed_queue_dequeue;
37 struct fixed_queue_enqueue fixed_queue_enqueue;
38 struct fixed_queue_flush fixed_queue_flush;
39 struct fixed_queue_free fixed_queue_free;
40 struct fixed_queue_get_dequeue_fd fixed_queue_get_dequeue_fd;
41 struct fixed_queue_get_enqueue_fd fixed_queue_get_enqueue_fd;
42 struct fixed_queue_get_list fixed_queue_get_list;
43 struct fixed_queue_is_empty fixed_queue_is_empty;
44 struct fixed_queue_length fixed_queue_length;
45 struct fixed_queue_new fixed_queue_new;
46 struct fixed_queue_register_dequeue fixed_queue_register_dequeue;
47 struct fixed_queue_try_dequeue fixed_queue_try_dequeue;
48 struct fixed_queue_try_enqueue fixed_queue_try_enqueue;
49 struct fixed_queue_try_peek_first fixed_queue_try_peek_first;
50 struct fixed_queue_try_peek_last fixed_queue_try_peek_last;
51 struct fixed_queue_try_remove_from_queue fixed_queue_try_remove_from_queue;
52 struct fixed_queue_unregister_dequeue fixed_queue_unregister_dequeue;
53 
54 }  // namespace osi_fixed_queue
55 }  // namespace mock
56 }  // namespace test
57 
58 // Mocked functions, if any
fixed_queue_capacity(fixed_queue_t * queue)59 size_t fixed_queue_capacity(fixed_queue_t* queue) {
60   inc_func_call_count(__func__);
61   return test::mock::osi_fixed_queue::fixed_queue_capacity(queue);
62 }
fixed_queue_dequeue(fixed_queue_t * queue)63 void* fixed_queue_dequeue(fixed_queue_t* queue) {
64   inc_func_call_count(__func__);
65   return test::mock::osi_fixed_queue::fixed_queue_dequeue(queue);
66 }
fixed_queue_enqueue(fixed_queue_t * queue,void * data)67 void fixed_queue_enqueue(fixed_queue_t* queue, void* data) {
68   inc_func_call_count(__func__);
69   test::mock::osi_fixed_queue::fixed_queue_enqueue(queue, data);
70 }
fixed_queue_flush(fixed_queue_t * queue,fixed_queue_free_cb free_cb)71 void fixed_queue_flush(fixed_queue_t* queue, fixed_queue_free_cb free_cb) {
72   inc_func_call_count(__func__);
73   test::mock::osi_fixed_queue::fixed_queue_flush(queue, free_cb);
74 }
fixed_queue_free(fixed_queue_t * queue,fixed_queue_free_cb free_cb)75 void fixed_queue_free(fixed_queue_t* queue, fixed_queue_free_cb free_cb) {
76   inc_func_call_count(__func__);
77   test::mock::osi_fixed_queue::fixed_queue_free(queue, free_cb);
78 }
fixed_queue_get_dequeue_fd(const fixed_queue_t * queue)79 int fixed_queue_get_dequeue_fd(const fixed_queue_t* queue) {
80   inc_func_call_count(__func__);
81   return test::mock::osi_fixed_queue::fixed_queue_get_dequeue_fd(queue);
82 }
fixed_queue_get_enqueue_fd(const fixed_queue_t * queue)83 int fixed_queue_get_enqueue_fd(const fixed_queue_t* queue) {
84   inc_func_call_count(__func__);
85   return test::mock::osi_fixed_queue::fixed_queue_get_enqueue_fd(queue);
86 }
fixed_queue_get_list(fixed_queue_t * queue)87 list_t* fixed_queue_get_list(fixed_queue_t* queue) {
88   inc_func_call_count(__func__);
89   return test::mock::osi_fixed_queue::fixed_queue_get_list(queue);
90 }
fixed_queue_is_empty(fixed_queue_t * queue)91 bool fixed_queue_is_empty(fixed_queue_t* queue) {
92   inc_func_call_count(__func__);
93   return test::mock::osi_fixed_queue::fixed_queue_is_empty(queue);
94 }
fixed_queue_length(fixed_queue_t * queue)95 size_t fixed_queue_length(fixed_queue_t* queue) {
96   inc_func_call_count(__func__);
97   return test::mock::osi_fixed_queue::fixed_queue_length(queue);
98 }
fixed_queue_new(size_t capacity)99 fixed_queue_t* fixed_queue_new(size_t capacity) {
100   inc_func_call_count(__func__);
101   return test::mock::osi_fixed_queue::fixed_queue_new(capacity);
102 }
fixed_queue_register_dequeue(fixed_queue_t * queue,reactor_t * reactor,fixed_queue_cb ready_cb,void * context)103 void fixed_queue_register_dequeue(fixed_queue_t* queue, reactor_t* reactor,
104                                   fixed_queue_cb ready_cb, void* context) {
105   inc_func_call_count(__func__);
106   test::mock::osi_fixed_queue::fixed_queue_register_dequeue(queue, reactor,
107                                                             ready_cb, context);
108 }
fixed_queue_try_dequeue(fixed_queue_t * queue)109 void* fixed_queue_try_dequeue(fixed_queue_t* queue) {
110   inc_func_call_count(__func__);
111   return test::mock::osi_fixed_queue::fixed_queue_try_dequeue(queue);
112 }
fixed_queue_try_enqueue(fixed_queue_t * queue,void * data)113 bool fixed_queue_try_enqueue(fixed_queue_t* queue, void* data) {
114   inc_func_call_count(__func__);
115   return test::mock::osi_fixed_queue::fixed_queue_try_enqueue(queue, data);
116 }
fixed_queue_try_peek_first(fixed_queue_t * queue)117 void* fixed_queue_try_peek_first(fixed_queue_t* queue) {
118   inc_func_call_count(__func__);
119   return test::mock::osi_fixed_queue::fixed_queue_try_peek_first(queue);
120 }
fixed_queue_try_peek_last(fixed_queue_t * queue)121 void* fixed_queue_try_peek_last(fixed_queue_t* queue) {
122   inc_func_call_count(__func__);
123   return test::mock::osi_fixed_queue::fixed_queue_try_peek_last(queue);
124 }
fixed_queue_try_remove_from_queue(fixed_queue_t * queue,void * data)125 void* fixed_queue_try_remove_from_queue(fixed_queue_t* queue, void* data) {
126   inc_func_call_count(__func__);
127   return test::mock::osi_fixed_queue::fixed_queue_try_remove_from_queue(queue,
128                                                                         data);
129 }
fixed_queue_unregister_dequeue(fixed_queue_t * queue)130 void fixed_queue_unregister_dequeue(fixed_queue_t* queue) {
131   inc_func_call_count(__func__);
132   test::mock::osi_fixed_queue::fixed_queue_unregister_dequeue(queue);
133 }
134 // Mocked functions complete
135 // END mockcify generation
136