• 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: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_immediate
61 // Params: void* value
62 // Return: future_t*
63 struct future_new_immediate {
64   future_t* return_value{0};
65   std::function<future_t*(void* value)> body{[this](void* /* value */) {
66     bluetooth::log::fatal("unexpectedly called");
67     return return_value;
68   }};
operatorfuture_new_immediate69   future_t* operator()(void* value) { return body(value); }
70 };
71 extern struct future_new_immediate future_new_immediate;
72 
73 // Name: future_ready
74 // Params: future_t* future, void* value
75 // Return: void
76 struct future_ready {
77   std::function<void(future_t* future, void* value)> body{
78           [](future_t* /* future */, void* /* value */) {}};
operatorfuture_ready79   void operator()(future_t* future, void* value) { body(future, value); }
80 };
81 extern struct future_ready future_ready;
82 
83 }  // namespace osi_future
84 }  // namespace mock
85 }  // namespace test
86 
87 // END mockcify generation
88