• 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:10
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 // Original included files, if any
32 // NOTE: Since this is a mock file with mock definitions some number of
33 //       include files may not be required.  The include-what-you-use
34 //       still applies, but crafting proper inclusion is out of scope
35 //       for this effort.  This compilation unit may compile as-is, or
36 //       may need attention to prune from (or add to ) the inclusion set.
37 #include <base/bind.h>
38 
39 #include <cstring>
40 #include <map>
41 #include <string>
42 
43 #include "bt_target.h"
44 #include "bta/sys/bta_sys.h"
45 #include "bta/sys/bta_sys_int.h"
46 #include "include/hardware/bluetooth.h"
47 #include "osi/include/alarm.h"
48 #include "osi/include/allocator.h"
49 #include "osi/include/log.h"
50 
51 // Mocked compile conditionals, if any
52 
53 namespace test {
54 namespace mock {
55 namespace bta_sys_main {
56 
57 // Shared state between mocked functions and tests
58 // Name: BTA_sys_signal_hw_error
59 // Params:
60 // Return: void
61 struct BTA_sys_signal_hw_error {
62   std::function<void()> body{[]() {}};
operatorBTA_sys_signal_hw_error63   void operator()() { body(); };
64 };
65 extern struct BTA_sys_signal_hw_error BTA_sys_signal_hw_error;
66 
67 // Name: bta_set_forward_hw_failures
68 // Params: bool value
69 // Return: void
70 struct bta_set_forward_hw_failures {
71   std::function<void(bool value)> body{[](bool value) {}};
operatorbta_set_forward_hw_failures72   void operator()(bool value) { body(value); };
73 };
74 extern struct bta_set_forward_hw_failures bta_set_forward_hw_failures;
75 
76 // Name: bta_sys_deregister
77 // Params: uint8_t id
78 // Return: void
79 struct bta_sys_deregister {
80   std::function<void(uint8_t id)> body{[](uint8_t id) {}};
operatorbta_sys_deregister81   void operator()(uint8_t id) { body(id); };
82 };
83 extern struct bta_sys_deregister bta_sys_deregister;
84 
85 // Name: bta_sys_disable
86 // Params:
87 // Return: void
88 struct bta_sys_disable {
89   std::function<void()> body{[]() {}};
operatorbta_sys_disable90   void operator()() { body(); };
91 };
92 extern struct bta_sys_disable bta_sys_disable;
93 
94 // Name: bta_sys_init
95 // Params: void
96 // Return: void
97 struct bta_sys_init {
98   std::function<void(void)> body{[](void) {}};
operatorbta_sys_init99   void operator()(void) { body(); };
100 };
101 extern struct bta_sys_init bta_sys_init;
102 
103 // Name: bta_sys_is_register
104 // Params: uint8_t id
105 // Return: bool
106 struct bta_sys_is_register {
107   bool return_value{false};
108   std::function<bool(uint8_t id)> body{
109       [this](uint8_t id) { return return_value; }};
operatorbta_sys_is_register110   bool operator()(uint8_t id) { return body(id); };
111 };
112 extern struct bta_sys_is_register bta_sys_is_register;
113 
114 // Name: bta_sys_register
115 // Params: uint8_t id, const tBTA_SYS_REG* p_reg
116 // Return: void
117 struct bta_sys_register {
118   std::function<void(uint8_t id, const tBTA_SYS_REG* p_reg)> body{
119       [](uint8_t id, const tBTA_SYS_REG* p_reg) {}};
operatorbta_sys_register120   void operator()(uint8_t id, const tBTA_SYS_REG* p_reg) { body(id, p_reg); };
121 };
122 extern struct bta_sys_register bta_sys_register;
123 
124 // Name: bta_sys_sendmsg
125 // Params: void* p_msg
126 // Return: void
127 struct bta_sys_sendmsg {
128   std::function<void(void* p_msg)> body{[](void* p_msg) {}};
operatorbta_sys_sendmsg129   void operator()(void* p_msg) { body(p_msg); };
130 };
131 extern struct bta_sys_sendmsg bta_sys_sendmsg;
132 
133 // Name: bta_sys_sendmsg_delayed
134 // Params: void* p_msg, const base::TimeDelta& delay
135 // Return: void
136 struct bta_sys_sendmsg_delayed {
137   std::function<void(void* p_msg, const base::TimeDelta& delay)> body{
138       [](void* p_msg, const base::TimeDelta& delay) {}};
operatorbta_sys_sendmsg_delayed139   void operator()(void* p_msg, const base::TimeDelta& delay) {
140     body(p_msg, delay);
141   };
142 };
143 extern struct bta_sys_sendmsg_delayed bta_sys_sendmsg_delayed;
144 
145 // Name: bta_sys_start_timer
146 // Params: alarm_t* alarm, uint64_t interval_ms, uint16_t event, uint16_t
147 // layer_specific Return: void
148 struct bta_sys_start_timer {
149   std::function<void(alarm_t* alarm, uint64_t interval_ms, uint16_t event,
150                      uint16_t layer_specific)>
151       body{[](alarm_t* alarm, uint64_t interval_ms, uint16_t event,
152               uint16_t layer_specific) {}};
operatorbta_sys_start_timer153   void operator()(alarm_t* alarm, uint64_t interval_ms, uint16_t event,
154                   uint16_t layer_specific) {
155     body(alarm, interval_ms, event, layer_specific);
156   };
157 };
158 extern struct bta_sys_start_timer bta_sys_start_timer;
159 
160 }  // namespace bta_sys_main
161 }  // namespace mock
162 }  // namespace test
163 
164 // END mockcify generation
165