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:4
20  *
21  *  mockcify.pl ver 0.3.0
22  */
23 
24 #include <functional>
25 
26 // Original included files, if any
27 
28 #include <bluetooth/log.h>
29 
30 #include "osi/include/future.h"
31 
32 // Mocked compile conditionals, if any
33 
34 namespace test {
35 namespace mock {
36 namespace osi_future {
37 
38 // Shared state between mocked functions and tests
39 // Name: future_await
40 // Params: future_t* future
41 // Return: void*
42 struct future_await {
43   void* return_value{};
44   std::function<void*(future_t* future)> body{
45       [this](future_t* /* future */) { return return_value; }};
operatorfuture_await46   void* operator()(future_t* future) { return body(future); };
47 };
48 extern struct future_await future_await;
49 
50 // Name: future_new
51 // Params: void
52 // Return: future_t*
53 struct future_new {
54   future_t* return_value{0};
55   std::function<future_t*(void)> body{[this](void) { return return_value; }};
operatorfuture_new56   future_t* operator()(void) { return body(); };
57 };
58 extern struct future_new future_new;
59 
60 // Name: future_new_named
61 // Params: const char* name
62 // Return: future_t*
63 struct future_new_named {
64   future_t* return_value{0};
65   std::function<future_t*(const char* name)> body{
66       [this](const char* /* name */) { return return_value; }};
operatorfuture_new_named67   future_t* operator()(const char* name) { return body(name); };
68 };
69 extern struct future_new_named future_new_named;
70 
71 // Name: future_new_immediate
72 // Params: void* value
73 // Return: future_t*
74 struct future_new_immediate {
75   future_t* return_value{0};
76   std::function<future_t*(void* value)> body{[this](void* /* value */) {
77     bluetooth::log::fatal("unexpectedly called");
78     return return_value;
79   }};
operatorfuture_new_immediate80   future_t* operator()(void* value) { return body(value); };
81 };
82 extern struct future_new_immediate future_new_immediate;
83 
84 // Name: future_ready
85 // Params: future_t* future, void* value
86 // Return: void
87 struct future_ready {
88   std::function<void(future_t* future, void* value)> body{
89       [](future_t* /* future */, void* /* value */) {}};
operatorfuture_ready90   void operator()(future_t* future, void* value) { body(future, value); };
91 };
92 extern struct future_ready future_ready;
93 
94 }  // namespace osi_future
95 }  // namespace mock
96 }  // namespace test
97 
98 // END mockcify generation
99