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