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