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:11
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_thread.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_thread {
33 
34 // Function state capture and return values, if needed
35 struct thread_free thread_free;
36 struct thread_get_reactor thread_get_reactor;
37 struct thread_is_self thread_is_self;
38 struct thread_join thread_join;
39 struct thread_name thread_name;
40 struct thread_new thread_new;
41 struct thread_new_sized thread_new_sized;
42 struct thread_post thread_post;
43 struct thread_set_priority thread_set_priority;
44 struct thread_set_rt_priority thread_set_rt_priority;
45 struct thread_stop thread_stop;
46 
47 }  // namespace osi_thread
48 }  // namespace mock
49 }  // namespace test
50 
51 // Mocked functions, if any
thread_free(thread_t * thread)52 void thread_free(thread_t* thread) {
53   inc_func_call_count(__func__);
54   test::mock::osi_thread::thread_free(thread);
55 }
thread_get_reactor(const thread_t * thread)56 reactor_t* thread_get_reactor(const thread_t* thread) {
57   inc_func_call_count(__func__);
58   return test::mock::osi_thread::thread_get_reactor(thread);
59 }
thread_is_self(const thread_t * thread)60 bool thread_is_self(const thread_t* thread) {
61   inc_func_call_count(__func__);
62   return test::mock::osi_thread::thread_is_self(thread);
63 }
thread_join(thread_t * thread)64 void thread_join(thread_t* thread) {
65   inc_func_call_count(__func__);
66   test::mock::osi_thread::thread_join(thread);
67 }
thread_name(const thread_t * thread)68 const char* thread_name(const thread_t* thread) {
69   inc_func_call_count(__func__);
70   return test::mock::osi_thread::thread_name(thread);
71 }
thread_new(const char * name)72 thread_t* thread_new(const char* name) {
73   inc_func_call_count(__func__);
74   return test::mock::osi_thread::thread_new(name);
75 }
thread_new_sized(const char * name,size_t work_queue_capacity)76 thread_t* thread_new_sized(const char* name, size_t work_queue_capacity) {
77   inc_func_call_count(__func__);
78   return test::mock::osi_thread::thread_new_sized(name, work_queue_capacity);
79 }
thread_post(thread_t * thread,thread_fn func,void * context)80 bool thread_post(thread_t* thread, thread_fn func, void* context) {
81   inc_func_call_count(__func__);
82   return test::mock::osi_thread::thread_post(thread, func, context);
83 }
thread_set_priority(thread_t * thread,int priority)84 bool thread_set_priority(thread_t* thread, int priority) {
85   inc_func_call_count(__func__);
86   return test::mock::osi_thread::thread_set_priority(thread, priority);
87 }
thread_set_rt_priority(thread_t * thread,int priority)88 bool thread_set_rt_priority(thread_t* thread, int priority) {
89   inc_func_call_count(__func__);
90   return test::mock::osi_thread::thread_set_rt_priority(thread, priority);
91 }
thread_stop(thread_t * thread)92 void thread_stop(thread_t* thread) {
93   inc_func_call_count(__func__);
94   test::mock::osi_thread::thread_stop(thread);
95 }
96 // Mocked functions complete
97 // END mockcify generation
98