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