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 <hardware/bluetooth.h> 29 30 #include "osi/include/alarm.h" 31 32 // Mocked compile conditionals, if any 33 34 namespace test { 35 namespace mock { 36 namespace osi_alarm { 37 38 // Shared state between mocked functions and tests 39 // Name: alarm_cancel 40 // Params: alarm_t* alarm 41 // Return: void 42 struct alarm_cancel { 43 std::function<void(alarm_t* alarm)> body{[](alarm_t* /* alarm */) {}}; operatoralarm_cancel44 void operator()(alarm_t* alarm) { body(alarm); }; 45 }; 46 extern struct alarm_cancel alarm_cancel; 47 48 // Name: alarm_cleanup 49 // Params: void 50 // Return: void 51 struct alarm_cleanup { 52 std::function<void(void)> body{[](void) {}}; operatoralarm_cleanup53 void operator()(void) { body(); }; 54 }; 55 extern struct alarm_cleanup alarm_cleanup; 56 57 // Name: alarm_debug_dump 58 // Params: int fd 59 // Return: void 60 struct alarm_debug_dump { 61 std::function<void(int fd)> body{[](int /* fd */) {}}; operatoralarm_debug_dump62 void operator()(int fd) { body(fd); }; 63 }; 64 extern struct alarm_debug_dump alarm_debug_dump; 65 66 // Name: alarm_free 67 // Params: alarm_t* alarm 68 // Return: void 69 struct alarm_free { 70 std::function<void(alarm_t* alarm)> body{[](alarm_t* /* alarm */) {}}; operatoralarm_free71 void operator()(alarm_t* alarm) { body(alarm); }; 72 }; 73 extern struct alarm_free alarm_free; 74 75 // Name: alarm_get_remaining_ms 76 // Params: const alarm_t* alarm 77 // Return: uint64_t 78 struct alarm_get_remaining_ms { 79 uint64_t return_value{0}; 80 std::function<uint64_t(const alarm_t* alarm)> body{ 81 [this](const alarm_t* /* alarm */) { return return_value; }}; operatoralarm_get_remaining_ms82 uint64_t operator()(const alarm_t* alarm) { return body(alarm); }; 83 }; 84 extern struct alarm_get_remaining_ms alarm_get_remaining_ms; 85 86 // Name: alarm_is_scheduled 87 // Params: const alarm_t* alarm 88 // Return: bool 89 struct alarm_is_scheduled { 90 bool return_value{false}; 91 std::function<bool(const alarm_t* alarm)> body{ 92 [this](const alarm_t* /* alarm */) { return return_value; }}; operatoralarm_is_scheduled93 bool operator()(const alarm_t* alarm) { return body(alarm); }; 94 }; 95 extern struct alarm_is_scheduled alarm_is_scheduled; 96 97 // Name: alarm_new 98 // Params: const char* name 99 // Return: alarm_t* 100 struct alarm_new { 101 alarm_t* return_value{0}; 102 std::function<alarm_t*(const char* name)> body{ 103 [this](const char* /* name */) { return return_value; }}; operatoralarm_new104 alarm_t* operator()(const char* name) { return body(name); }; 105 }; 106 extern struct alarm_new alarm_new; 107 108 // Name: alarm_new_periodic 109 // Params: const char* name 110 // Return: alarm_t* 111 struct alarm_new_periodic { 112 alarm_t* return_value{0}; 113 std::function<alarm_t*(const char* name)> body{ 114 [this](const char* /* name */) { return return_value; }}; operatoralarm_new_periodic115 alarm_t* operator()(const char* name) { return body(name); }; 116 }; 117 extern struct alarm_new_periodic alarm_new_periodic; 118 119 // Name: alarm_set 120 // Params: alarm_t* alarm, uint64_t interval_ms, alarm_callback_t cb, void* data 121 // Return: void 122 struct alarm_set { 123 std::function<void(alarm_t* alarm, uint64_t interval_ms, alarm_callback_t cb, 124 void* data)> 125 body{[](alarm_t* /* alarm */, uint64_t /* interval_ms */, 126 alarm_callback_t /* cb */, void* /* data */) {}}; operatoralarm_set127 void operator()(alarm_t* alarm, uint64_t interval_ms, alarm_callback_t cb, 128 void* data) { 129 body(alarm, interval_ms, cb, data); 130 }; 131 }; 132 extern struct alarm_set alarm_set; 133 134 // Name: alarm_set_on_mloop 135 // Params: alarm_t* alarm, uint64_t interval_ms, alarm_callback_t cb, void* data 136 // Return: void 137 struct alarm_set_on_mloop { 138 std::function<void(alarm_t* alarm, uint64_t interval_ms, alarm_callback_t cb, 139 void* data)> 140 body{[](alarm_t* /* alarm */, uint64_t /* interval_ms */, 141 alarm_callback_t /* cb */, void* /* data */) {}}; operatoralarm_set_on_mloop142 void operator()(alarm_t* alarm, uint64_t interval_ms, alarm_callback_t cb, 143 void* data) { 144 body(alarm, interval_ms, cb, data); 145 }; 146 }; 147 extern struct alarm_set_on_mloop alarm_set_on_mloop; 148 149 } // namespace osi_alarm 150 } // namespace mock 151 } // namespace test 152 153 // END mockcify generation 154