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 27 // Original included files, if any 28 #include "bta/sys/bta_sys.h" 29 #include "osi/include/alarm.h" 30 31 // Mocked compile conditionals, if any 32 33 namespace test { 34 namespace mock { 35 namespace bta_sys_main { 36 37 // Shared state between mocked functions and tests 38 // Name: BTA_sys_signal_hw_error 39 // Params: 40 // Return: void 41 struct BTA_sys_signal_hw_error { 42 std::function<void()> body{[]() {}}; operatorBTA_sys_signal_hw_error43 void operator()() { body(); }; 44 }; 45 extern struct BTA_sys_signal_hw_error BTA_sys_signal_hw_error; 46 47 // Name: bta_sys_deregister 48 // Params: uint8_t id 49 // Return: void 50 struct bta_sys_deregister { 51 std::function<void(uint8_t id)> body{[](uint8_t /* id */) {}}; operatorbta_sys_deregister52 void operator()(uint8_t id) { body(id); }; 53 }; 54 extern struct bta_sys_deregister bta_sys_deregister; 55 56 // Name: bta_sys_disable 57 // Params: 58 // Return: void 59 struct bta_sys_disable { 60 std::function<void()> body{[]() {}}; operatorbta_sys_disable61 void operator()() { body(); }; 62 }; 63 extern struct bta_sys_disable bta_sys_disable; 64 65 // Name: bta_sys_init 66 // Params: void 67 // Return: void 68 struct bta_sys_init { 69 std::function<void(void)> body{[](void) {}}; operatorbta_sys_init70 void operator()(void) { body(); }; 71 }; 72 extern struct bta_sys_init bta_sys_init; 73 74 // Name: bta_sys_is_register 75 // Params: uint8_t id 76 // Return: bool 77 struct bta_sys_is_register { 78 bool return_value{false}; 79 std::function<bool(uint8_t id)> body{ 80 [this](uint8_t /* id */) { return return_value; }}; operatorbta_sys_is_register81 bool operator()(uint8_t id) { return body(id); }; 82 }; 83 extern struct bta_sys_is_register bta_sys_is_register; 84 85 // Name: bta_sys_register 86 // Params: uint8_t id, const tBTA_SYS_REG* p_reg 87 // Return: void 88 struct bta_sys_register { 89 std::function<void(uint8_t id, const tBTA_SYS_REG* p_reg)> body{ 90 [](uint8_t /* id */, const tBTA_SYS_REG* /* p_reg */) {}}; operatorbta_sys_register91 void operator()(uint8_t id, const tBTA_SYS_REG* p_reg) { body(id, p_reg); }; 92 }; 93 extern struct bta_sys_register bta_sys_register; 94 95 // Name: bta_sys_sendmsg 96 // Params: void* p_msg 97 // Return: void 98 struct bta_sys_sendmsg { 99 std::function<void(void* p_msg)> body{[](void* /* p_msg */) {}}; operatorbta_sys_sendmsg100 void operator()(void* p_msg) { body(p_msg); }; 101 }; 102 extern struct bta_sys_sendmsg bta_sys_sendmsg; 103 104 // Name: bta_sys_sendmsg_delayed 105 // Params: void* p_msg, std::chrono::microseconds delay 106 // Return: void 107 struct bta_sys_sendmsg_delayed { 108 std::function<void(void* p_msg, std::chrono::microseconds delay)> body{ 109 [](void* /* p_msg */, std::chrono::microseconds /* delay */) {}}; operatorbta_sys_sendmsg_delayed110 void operator()(void* p_msg, std::chrono::microseconds delay) { 111 body(p_msg, delay); 112 }; 113 }; 114 extern struct bta_sys_sendmsg_delayed bta_sys_sendmsg_delayed; 115 116 // Name: bta_sys_start_timer 117 // Params: alarm_t* alarm, uint64_t interval_ms, uint16_t event, uint16_t 118 // layer_specific Return: void 119 struct bta_sys_start_timer { 120 std::function<void(alarm_t* alarm, uint64_t interval_ms, uint16_t event, 121 uint16_t layer_specific)> 122 body{[](alarm_t* /* alarm */, uint64_t /* interval_ms */, 123 uint16_t /* event */, uint16_t /* layer_specific */) {}}; operatorbta_sys_start_timer124 void operator()(alarm_t* alarm, uint64_t interval_ms, uint16_t event, 125 uint16_t layer_specific) { 126 body(alarm, interval_ms, event, layer_specific); 127 }; 128 }; 129 extern struct bta_sys_start_timer bta_sys_start_timer; 130 131 } // namespace bta_sys_main 132 } // namespace mock 133 } // namespace test 134 135 // END mockcify generation 136