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