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:19
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_list.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_list {
33
34 // Function state capture and return values, if needed
35 struct list_append list_append;
36 struct list_back list_back;
37 struct list_back_node list_back_node;
38 struct list_begin list_begin;
39 struct list_clear list_clear;
40 struct list_contains list_contains;
41 struct list_end list_end;
42 struct list_foreach list_foreach;
43 struct list_free list_free;
44 struct list_front list_front;
45 struct list_insert_after list_insert_after;
46 struct list_is_empty list_is_empty;
47 struct list_length list_length;
48 struct list_new list_new;
49 struct list_new_internal list_new_internal;
50 struct list_next list_next;
51 struct list_node list_node;
52 struct list_prepend list_prepend;
53 struct list_remove list_remove;
54
55 } // namespace osi_list
56 } // namespace mock
57 } // namespace test
58
59 // Mocked functions, if any
list_append(list_t * list,void * data)60 bool list_append(list_t* list, void* data) {
61 inc_func_call_count(__func__);
62 return test::mock::osi_list::list_append(list, data);
63 }
list_back(const list_t * list)64 void* list_back(const list_t* list) {
65 inc_func_call_count(__func__);
66 return test::mock::osi_list::list_back(list);
67 }
list_back_node(const list_t * list)68 list_node_t* list_back_node(const list_t* list) {
69 inc_func_call_count(__func__);
70 return test::mock::osi_list::list_back_node(list);
71 }
list_begin(const list_t * list)72 list_node_t* list_begin(const list_t* list) {
73 inc_func_call_count(__func__);
74 return test::mock::osi_list::list_begin(list);
75 }
list_clear(list_t * list)76 void list_clear(list_t* list) {
77 inc_func_call_count(__func__);
78 test::mock::osi_list::list_clear(list);
79 }
list_contains(const list_t * list,const void * data)80 bool list_contains(const list_t* list, const void* data) {
81 inc_func_call_count(__func__);
82 return test::mock::osi_list::list_contains(list, data);
83 }
list_end(const list_t * list)84 list_node_t* list_end(const list_t* list) {
85 inc_func_call_count(__func__);
86 return test::mock::osi_list::list_end(list);
87 }
list_foreach(const list_t * list,list_iter_cb callback,void * context)88 list_node_t* list_foreach(const list_t* list, list_iter_cb callback,
89 void* context) {
90 inc_func_call_count(__func__);
91 return test::mock::osi_list::list_foreach(list, callback, context);
92 }
list_free(list_t * list)93 void list_free(list_t* list) {
94 inc_func_call_count(__func__);
95 test::mock::osi_list::list_free(list);
96 }
list_front(const list_t * list)97 void* list_front(const list_t* list) {
98 inc_func_call_count(__func__);
99 return test::mock::osi_list::list_front(list);
100 }
list_insert_after(list_t * list,list_node_t * prev_node,void * data)101 bool list_insert_after(list_t* list, list_node_t* prev_node, void* data) {
102 inc_func_call_count(__func__);
103 return test::mock::osi_list::list_insert_after(list, prev_node, data);
104 }
list_is_empty(const list_t * list)105 bool list_is_empty(const list_t* list) {
106 inc_func_call_count(__func__);
107 return test::mock::osi_list::list_is_empty(list);
108 }
list_length(const list_t * list)109 size_t list_length(const list_t* list) {
110 inc_func_call_count(__func__);
111 return test::mock::osi_list::list_length(list);
112 }
list_new(list_free_cb callback)113 list_t* list_new(list_free_cb callback) {
114 inc_func_call_count(__func__);
115 return test::mock::osi_list::list_new(callback);
116 }
list_new_internal(list_free_cb callback,const allocator_t * zeroed_allocator)117 list_t* list_new_internal(list_free_cb callback,
118 const allocator_t* zeroed_allocator) {
119 inc_func_call_count(__func__);
120 return test::mock::osi_list::list_new_internal(callback, zeroed_allocator);
121 }
list_next(const list_node_t * node)122 list_node_t* list_next(const list_node_t* node) {
123 inc_func_call_count(__func__);
124 return test::mock::osi_list::list_next(node);
125 }
list_node(const list_node_t * node)126 void* list_node(const list_node_t* node) {
127 inc_func_call_count(__func__);
128 return test::mock::osi_list::list_node(node);
129 }
list_prepend(list_t * list,void * data)130 bool list_prepend(list_t* list, void* data) {
131 inc_func_call_count(__func__);
132 return test::mock::osi_list::list_prepend(list, data);
133 }
list_remove(list_t * list,void * data)134 bool list_remove(list_t* list, void* data) {
135 inc_func_call_count(__func__);
136 return test::mock::osi_list::list_remove(list, data);
137 }
138 // Mocked functions complete
139 // END mockcify generation
140